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

Add generate kwargs to Seq2SeqTrainingArguments #13339

Merged
merged 4 commits into from Aug 31, 2021
Merged

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Aug 30, 2021

What does this PR do?

This PR adds two new Seq2SeqTrainingArguments to control which max_length and num_beams are used during the intermediate evaluations of the Seq2SeqTrainer. This feature has been requested multiple times, the last in date being #13252.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Thanks @sgugger

Comment on lines 44 to 57
generate_max_length: Optional[int] = field(
default=None,
metadata={
"help": "The `max_length` to use on each evaluation loop when `predict_with_generate=True`. Will default "
"to the `max_length` value of the model configuration."
},
)
generate_num_beams: Optional[int] = field(
default=None,
metadata={
"help": "The `num_beams` to use on each evaluation loop when `predict_with_generate=True`. Will default "
"to the `num_beams` value of the model configuration."
},
)
Copy link
Member

Choose a reason for hiding this comment

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

The generate_* name comes from the generate method, but for users that aren't power-users I don't think it's the best name as the verb implies an action; how about renaming to generation_max_length and generation_num_beans?

@sgugger sgugger merged commit c76de10 into master Aug 31, 2021
@sgugger sgugger deleted the seq2seq_generate_kwargs branch August 31, 2021 12:42
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