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

Fix wrong truncating index of tensor in DPOTrainer's concatenated_forward() #2332

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

yanghh2000
Copy link
Contributor

What does this PR do?

Fixes #2330 (issue)

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a GitHub issue? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@kashif
Copy link
Collaborator

kashif commented Nov 6, 2024

thanks @yanghh2000 would it be possible to add a test?

@yanghh2000
Copy link
Contributor Author

Hi, I am glad to help, but I am not sure how to add a test for this. Is there any guideline to test a PR?

@yanghh2000
Copy link
Contributor Author

Oh, I have read the guideline in trl/CONTRIBUTING.md, and what I need to do is add a test.py and commit it under test/ dir?

@kashif
Copy link
Collaborator

kashif commented Nov 6, 2024

yes in the dpo_trainer tests file

@qgallouedec
Copy link
Member

qgallouedec commented Nov 6, 2024

Tbh I'm not sure it is possible to test it considering it's in a middle of the method.

@kashif kashif added the 🐛 bug Something isn't working label Nov 6, 2024
@kashif kashif merged commit 7f2ccbe into huggingface:main Nov 7, 2024
@yanghh2000 yanghh2000 deleted the fix-DPO-truncate branch November 7, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong tensor index for roll and truncate in DPOTrainer fn concatenated_forward( ).
3 participants