Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
bfbe68f0
"git@developer.sourcefind.cn:wuxk1/megatron-lm.git" did not exist on "d928dd5159ff95a380f8169e43b06d69abe006ec"
Commit
bfbe68f0
authored
Oct 14, 2019
by
thomwolf
Browse files
update forward pass
parent
0ef9bc92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
transformers/modeling_seq2seq.py
transformers/modeling_seq2seq.py
+3
-1
No files found.
transformers/modeling_seq2seq.py
View file @
bfbe68f0
...
@@ -218,12 +218,14 @@ class PreTrainedSeq2seq(nn.Module):
...
@@ -218,12 +218,14 @@ class PreTrainedSeq2seq(nn.Module):
if
encoder_hidden_states
is
None
:
if
encoder_hidden_states
is
None
:
encoder_outputs
=
self
.
encoder
(
*
inputs
,
*
kwargs
)
encoder_outputs
=
self
.
encoder
(
*
inputs
,
*
kwargs
)
encoder_hidden_states
=
encoder_outputs
[
0
]
encoder_hidden_states
=
encoder_outputs
[
0
]
else
:
encoder_outputs
=
(,)
# Decode
# Decode
decoder_kwargs
[
'encoder_hidden_states'
]
=
encoder_hidden_states
decoder_kwargs
[
'encoder_hidden_states'
]
=
encoder_hidden_states
decoder_outputs
=
self
.
decoder
(
**
decoder_kwargs
)
decoder_outputs
=
self
.
decoder
(
**
decoder_kwargs
)
return
decoder_outputs
return
decoder_outputs
+
encoder_outputs
class
Model2Model
(
PreTrainedSeq2seq
):
class
Model2Model
(
PreTrainedSeq2seq
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment