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
c912ba5f
Unverified
Commit
c912ba5f
authored
Oct 19, 2020
by
Patrick von Platen
Committed by
GitHub
Oct 19, 2020
Browse files
[EncoderDecoder] Fix Typo (#7915)
* fix encoder decoder models * add .gitignore
parent
55bcd0cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
2 deletions
+3
-2
.gitignore
.gitignore
+3
-0
src/transformers/modeling_encoder_decoder.py
src/transformers/modeling_encoder_decoder.py
+0
-2
No files found.
.gitignore
View file @
c912ba5f
...
@@ -157,3 +157,6 @@ debug.env
...
@@ -157,3 +157,6 @@ debug.env
#ctags
#ctags
tags
tags
# pre-commit
.pre-commit*
src/transformers/modeling_encoder_decoder.py
View file @
c912ba5f
...
@@ -434,8 +434,6 @@ class EncoderDecoderModel(PreTrainedModel):
...
@@ -434,8 +434,6 @@ class EncoderDecoderModel(PreTrainedModel):
encoder_attentions
=
encoder_outputs
.
attentions
,
encoder_attentions
=
encoder_outputs
.
attentions
,
)
)
return
decoder_outputs
+
encoder_outputs
def
prepare_inputs_for_generation
(
self
,
input_ids
,
past
,
attention_mask
,
encoder_outputs
,
**
kwargs
):
def
prepare_inputs_for_generation
(
self
,
input_ids
,
past
,
attention_mask
,
encoder_outputs
,
**
kwargs
):
decoder_inputs
=
self
.
decoder
.
prepare_inputs_for_generation
(
input_ids
)
decoder_inputs
=
self
.
decoder
.
prepare_inputs_for_generation
(
input_ids
)
decoder_attention_mask
=
decoder_inputs
[
"attention_mask"
]
if
"attention_mask"
in
decoder_inputs
else
None
decoder_attention_mask
=
decoder_inputs
[
"attention_mask"
]
if
"attention_mask"
in
decoder_inputs
else
None
...
...
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