79790477

Date: 2025-10-14 18:06:06
Score: 1
Natty:
Report link

To solve the issue, I replaced DataCollatorWithPadding with DataCollatorForLanguageModeling.

data_collator = DataCollatorForLanguageModeling(tokenizer=tokenizer,mlm=False)

DataCollatorForLanguageModeling automatically creates the labels column, so you don’t need to generate it manually in your code. This change fixed the problem.

Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: karyx1