fix return dicitonary labels from masked_lm_labels to labels (#7595)
This commit is contained in:
@@ -446,7 +446,7 @@ class DataCollatorForNextSentencePrediction:
|
|||||||
"input_ids": input_ids,
|
"input_ids": input_ids,
|
||||||
"attention_mask": self._tensorize_batch(attention_masks),
|
"attention_mask": self._tensorize_batch(attention_masks),
|
||||||
"token_type_ids": self._tensorize_batch(segment_ids),
|
"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),
|
"next_sentence_label": torch.tensor(nsp_labels),
|
||||||
}
|
}
|
||||||
if self.mlm:
|
if self.mlm:
|
||||||
|
|||||||
Reference in New Issue
Block a user