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
03885a3f
"docs/vscode:/vscode.git/clone" did not exist on "73fcfb286184114207da5b6400d78a7f7e0fa79e"
Unverified
Commit
03885a3f
authored
Dec 27, 2021
by
Ayal Klein
Committed by
GitHub
Dec 27, 2021
Browse files
fix to issue #14833 in data_collator - consider no labels (#14930)
parent
501307b5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
src/transformers/data/data_collator.py
src/transformers/data/data_collator.py
+5
-1
No files found.
src/transformers/data/data_collator.py
View file @
03885a3f
...
@@ -591,7 +591,11 @@ class DataCollatorForSeq2Seq:
...
@@ -591,7 +591,11 @@ class DataCollatorForSeq2Seq:
)
)
# prepare decoder_input_ids
# prepare decoder_input_ids
if
self
.
model
is
not
None
and
hasattr
(
self
.
model
,
"prepare_decoder_input_ids_from_labels"
):
if
(
labels
is
not
None
and
self
.
model
is
not
None
and
hasattr
(
self
.
model
,
"prepare_decoder_input_ids_from_labels"
)
):
decoder_input_ids
=
self
.
model
.
prepare_decoder_input_ids_from_labels
(
labels
=
features
[
"labels"
])
decoder_input_ids
=
self
.
model
.
prepare_decoder_input_ids_from_labels
(
labels
=
features
[
"labels"
])
features
[
"decoder_input_ids"
]
=
decoder_input_ids
features
[
"decoder_input_ids"
]
=
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