-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Generate: throw warning when return_dict_in_generate
is False but should be True
#33146
Conversation
@@ -786,7 +798,8 @@ def save_pretrained( | |||
|
|||
if use_auth_token is not None: | |||
warnings.warn( | |||
"The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. Please use `token` instead.", | |||
"The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers. " |
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.
(>120 chars/line)
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.
Thanks, saw a few related issue !
if getattr(self, extra_output_flag) is True: | ||
warnings.warn( | ||
f"`return_dict_in_generate` is NOT set to `True`, but `{extra_output_flag}` is. When " | ||
f"`return_dict_in_generate` is not `True`, `{extra_output_flag}` will not be respected.", | ||
UserWarning, | ||
) |
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.
yep good catch!
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. |
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.
Indeed, nice! LGTM, thanks @gante
f93cf14
to
fce676b
Compare
…set in the model config
What does this PR do?
See title.
I've fallen victim to this one a few times, so it probably means users have fallen too :)