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

remove the bos token from dpo outputs #1733

Merged
merged 4 commits into from
Nov 16, 2024
Merged

remove the bos token from dpo outputs #1733

merged 4 commits into from
Nov 16, 2024

Conversation

winglian
Copy link
Collaborator

Fixes #1616

if res["prompt_input_ids"][0] == self.tokenizer.bos_token_id:
res["prompt_input_ids"] = res["prompt_input_ids"][1:]
res["prompt_attention_mask"] = res["prompt_attention_mask"][1:]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the linked Issue, we should only remove the BOS from the chosen/rejected, right? The prompt should not require it?

If it does require removing bos, does res["prompt_labels"] exist & do we need to remove it also?

@winglian winglian merged commit 521e62d into main Nov 16, 2024
11 checks passed
@winglian winglian deleted the dpo-outouts-no-bos branch November 16, 2024 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DPO Trainer Incorrectly Inserts BoS Before Chosen and Rejected Prompts for Llama3
2 participants