Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataCollatorForLanguageModeling uses the unmasked labels #143

Open
shuiyueche opened this issue Jun 11, 2023 · 0 comments
Open

DataCollatorForLanguageModeling uses the unmasked labels #143

shuiyueche opened this issue Jun 11, 2023 · 0 comments

Comments

@shuiyueche
Copy link

In finetune.py, the Line 226 uses the tranformers.DataCollatorForLanguageModeling. This data collator actually ignores the "labels" field in line 185 and uses "input_ids" as the new labels in the trainer.train() function. You can see this behavior in the Line 745 of transformers.data_collator

Compared against the implementation of stanford_alpaca, its train.py uses the masked "labels" as the line 122~123 shows (This is the same purpose as your "labels" in line 185). But since the code write its own dataset and collator. The "labels" is not overwritten later in the training.

I wonder if the use of tranformers.DataCollatorForLanguageModeling in finetune.py is a bug. Does it serve the purpose here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant