-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add missing doc strings in SFTrainer #4003
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
Add missing doc strings in SFTrainer #4003
Conversation
|
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. |
|
I think |
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
I think it is used because it is passed to the trl/trl/trainer/sft_trainer.py Lines 822 to 829 in 6799160
The Trainer calls the passed I actually think having this is a nice way to allow users to experiment with their own loss functions, so would refrain from getting rid of it. This PR in progress also serves as an example of how one can use the |
|
|
Yes but even the overwritten version calls the trainer's implementation of trl/trl/trainer/sft_trainer.py Lines 1041 to 1043 in 0c69fd2
Relevant code in |
|
My bad you're right! |
qgallouedec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com> Co-authored-by: Quentin Gallouédec <gallouedec.quentin@gmail.com>
What does this PR do?
The
SFTTrainercurrently misses doc strings for thecompute_loss_funcandcompute_metricsconstructor args. Both of these are passed on to the parentTrainerClass's constructor. This PR adds them, copied over from the Trainer class from the Transformers lib.Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
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.