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

[Online-DPO] num_generation_per_prompt is fixed #1898

Merged
merged 11 commits into from
Aug 6, 2024

Conversation

kashif
Copy link
Collaborator

@kashif kashif commented Aug 3, 2024

  • num_generation_per_prompt is always 2 for the online DPO case
  • removed un-needed with torch.no_grad():

@kashif kashif requested a review from qgallouedec August 3, 2024 11:22
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@kashif kashif changed the title [Online-DPO] num_generation_per_prompt is fixed [Online-DPO] num_generation_per_prompt is fixed and fix scores Aug 5, 2024
@qgallouedec
Copy link
Member

Important: seems like eos penalty had an error

- scores = torch.where(contain_eos_token, scores, args.penalty_reward_value)
+ scores = torch.where(contain_eos_token, args.penalty_reward_value, scores)

@kashif kashif changed the title [Online-DPO] num_generation_per_prompt is fixed and fix scores [Online-DPO] num_generation_per_prompt is fixed Aug 5, 2024
@@ -287,14 +288,13 @@ def repeat_generator():
del logits, all_logprob
torch.cuda.empty_cache()

with torch.no_grad():
Copy link
Member

@qgallouedec qgallouedec Aug 6, 2024

Choose a reason for hiding this comment

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

Is it because ref model is in eval mode that you don't need to use the context?

@kashif kashif merged commit fc76fe8 into huggingface:main Aug 6, 2024
9 checks passed
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

Successfully merging this pull request may close these issues.

3 participants