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

[PPOTrainer] make the reference model optional #67

Merged
merged 6 commits into from
Dec 30, 2022

Conversation

younesbelkada
Copy link
Contributor

@younesbelkada younesbelkada commented Dec 30, 2022

This PR makes passing the reference model optional for the trainer, so that a user can just create a model without creating a reference model, and pass it to the trainer to create a shared model

cc @lvwerra @lewtun

This PR also refactors the trainer test, and adds nice tests too

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Dec 30, 2022

The documentation is not available anymore as the PR was closed or merged.

@younesbelkada younesbelkada mentioned this pull request Dec 30, 2022
26 tasks
Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

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

Generally looks great! I think we can pass the num_shared_layers explicitly. Maybe if both ref model and the num_shared_layers is provided we can create a warning saying that the latter wont be used.

Wdyt?

trl/trainer/ppo_trainer.py Outdated Show resolved Hide resolved
younesbelkada and others added 2 commits December 30, 2022 12:23
Co-authored-by: Leandro von Werra <lvwerra@users.noreply.github.com>
@younesbelkada younesbelkada merged commit 4ec9255 into huggingface:master Dec 30, 2022
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.

None yet

3 participants