Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
bfbe68f0
Commit
bfbe68f0
authored
Oct 14, 2019
by
thomwolf
Browse files
update forward pass
parent
0ef9bc92
Changes
1
Hide 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):
if
encoder_hidden_states
is
None
:
encoder_outputs
=
self
.
encoder
(
*
inputs
,
*
kwargs
)
encoder_hidden_states
=
encoder_outputs
[
0
]
else
:
encoder_outputs
=
(,)
# Decode
decoder_kwargs
[
'encoder_hidden_states'
]
=
encoder_hidden_states
decoder_outputs
=
self
.
decoder
(
**
decoder_kwargs
)
return
decoder_outputs
return
decoder_outputs
+
encoder_outputs
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