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
4d541f51
Unverified
Commit
4d541f51
authored
Oct 06, 2020
by
George Mihaila
Committed by
GitHub
Oct 06, 2020
Browse files
fix return dicitonary labels from masked_lm_labels to labels (#7595)
parent
8d2c248d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/data/data_collator.py
src/transformers/data/data_collator.py
+1
-1
No files found.
src/transformers/data/data_collator.py
View file @
4d541f51
...
...
@@ -446,7 +446,7 @@ class DataCollatorForNextSentencePrediction:
"input_ids"
:
input_ids
,
"attention_mask"
:
self
.
_tensorize_batch
(
attention_masks
),
"token_type_ids"
:
self
.
_tensorize_batch
(
segment_ids
),
"
masked_lm_
labels"
:
mlm_labels
if
self
.
mlm
else
None
,
"labels"
:
mlm_labels
if
self
.
mlm
else
None
,
"next_sentence_label"
:
torch
.
tensor
(
nsp_labels
),
}
if
self
.
mlm
:
...
...
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