Unverified Commit 0b418673 authored by Suraj Patil's avatar Suraj Patil Committed by GitHub
Browse files

fix labels (#6213)

parent cedc547e
......@@ -87,6 +87,7 @@ class DataCollatorForLanguageModeling:
return {"input_ids": inputs, "labels": labels}
else:
labels = batch.clone().detach()
if self.tokenizer.pad_token_id is not None:
labels[labels == self.tokenizer.pad_token_id] = -100
return {"input_ids": batch, "labels": labels}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment