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
68209044
Unverified
Commit
68209044
authored
Jan 12, 2022
by
Yih-Dar
Committed by
GitHub
Jan 12, 2022
Browse files
Fix #14357 (#15001)
Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
aa0135f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/transformers/models/encoder_decoder/modeling_tf_encoder_decoder.py
...ers/models/encoder_decoder/modeling_tf_encoder_decoder.py
+6
-0
No files found.
src/transformers/models/encoder_decoder/modeling_tf_encoder_decoder.py
View file @
68209044
...
...
@@ -540,6 +540,12 @@ class TFEncoderDecoderModel(TFPreTrainedModel):
encoder_inputs
=
input_processing
(
**
encoder_processing_inputs
)
# Handle the case where the inputs are passed as a single dict which contains `labels`.
# The `labels` shouldn't be passed to `self.encoder` below, because it is a based model without this
# parameter (otherwise, an error occurs when `input_processing` is called inside `self.encoder.call()`).
if
"labels"
in
encoder_inputs
:
labels
=
encoder_inputs
.
pop
(
"labels"
)
# handle the init case where `dummy_inputs` returns a dict containing `decoder_input_ids`.
if
"decoder_input_ids"
in
encoder_inputs
:
decoder_input_ids
=
encoder_inputs
.
pop
(
"decoder_input_ids"
)
...
...
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