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

Bug with: precompute_train_ref_log_probs #1139

Closed
AjayP13 opened this issue Dec 24, 2023 · 4 comments
Closed

Bug with: precompute_train_ref_log_probs #1139

AjayP13 opened this issue Dec 24, 2023 · 4 comments

Comments

@AjayP13
Copy link
Contributor

AjayP13 commented Dec 24, 2023

This line was not properly changed when #885 added the precompute_train_ref_log_probs option:

https://github.com/huggingface/trl/blob/8f5b4923c8caca1f352581eb6f2fda583517b1a6/trl/trainer/dpo_trainer.py#L935C41-L935C41

If precompute_train_ref_log_probs=True, then ref_model=None. If ref_model=None, then the model is assumed to be PEFT (even if it is not) on this line. Therefore, the .disable_adapter() fails, because the model is not a PEFT model.

Tagging: @kashif @lvwerra @younesbelkada

@kashif
Copy link
Collaborator

kashif commented Dec 24, 2023

@AjayP13 ah yes do you want to make a fix?

@AjayP13
Copy link
Contributor Author

AjayP13 commented Dec 24, 2023

Yes, I can try to get to it later today, I believe it would just be testing for self.is_peft_model there instead.

@AjayP13
Copy link
Contributor Author

AjayP13 commented Dec 25, 2023

Turns out this was a mistake on my side, sorry for the ping! The implementation is actually correct (we were just dropping the logp columns). Closing this out.

@AjayP13 AjayP13 closed this as completed Dec 25, 2023
@raghavgarg97
Copy link

@AjayP13 can u mention what exactly is the issue as I am facing similar problem?

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

3 participants