-
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
added eos token for ppotrainer #2420
base: main
Are you sure you want to change the base?
Conversation
trl/trainer/ppo_trainer.py
Outdated
self.model.generation_config.eos_token_id = self.processing_class.eos_token_id | ||
elif hasattr(self.model.config, "eos_token_id") and self.args.use_model_eos_token: | ||
# Fallback to model config's EOS token | ||
self.model.generation_config.eos_token_id = self.model.config.eos_token_id |
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.
Maybe this line is enough? Why would we need two options?
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 remove this line
elif hasattr(self.model.config, "eos_token_id") and self.args.use_model_eos_token:
# Fallback to model config's EOS token
self.model.generation_config.eos_token_id = self.model.config.eos_token_id
and kept the one which uses the tokenizer
I tested it locally and it seems to be doing fine the training was done perfectly with and without the eos_token_id
Do i need to like write custom tests or documentation ?
What does this PR do?
Fixes 2387
use_model_eos_token
in theppo_conifg.py
to add kind of a way for the user to make configuration ,do we like this or just make it default with no configuration ?
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines.
Who can review?
@qgallouedec