-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Standardise API for WinRateCallback
and LogCompletionsCallback
#2061
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. |
@@ -17,7 +17,7 @@ | |||
python examples/scripts/gkd.py \ | |||
--model_name_or_path Qwen/Qwen2-0.5B-Instruct \ | |||
--teacher_model_name_or_path Qwen/Qwen2-1.5B-Instruct \ | |||
--dataset_name andito/chatbot_arena_completions \ | |||
--dataset_name trl-lib/chatbot_arena_conversations \ |
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.
I switched to this dataset since the original doesn't have an eval split
WinRateCallback
and LogCompletionsCallback
WinRateCallback
and LogCompletionsCallback
@@ -62,7 +62,7 @@ | |||
"ddpo_config": ["DDPOConfig"], | |||
"gkd_trainer": ["GKDTrainer"], | |||
"gkd_config": ["GKDConfig"], | |||
"callbacks": ["RichProgressCallback", "SyncRefModelCallback", "WinRateCallback"], | |||
"callbacks": ["RichProgressCallback", "SyncRefModelCallback", "WinRateCallback", "LogCompletionsCallback"], |
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.
I unified the import path for the callbacks too
LGTM, it looks way better now! |
What does this PR do?
This PR unifies the API for the
WinRate
andLogCompletion
callbacks (previously, the latter required the prompts to be passed manually, sampling was tied to the training config etc). The new way to use them is as follows:Doing so allowed me to also fix a bug we had in
LogCompletionCallback
where ZeRO-3 would hang during generation (the trick is to access and unwrap the model from the trainer withunload_model_for_generation()
)Scripts tested
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines.
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.