-
Notifications
You must be signed in to change notification settings - Fork 31.2k
Generate: validate model_kwargs on TF (and catch typos in generate arguments)
#18651
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
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
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.
moved from test_modeling_tf_common, no changes
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.
moved from test_modeling_tf_common, added the @slow (takes >30s)
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.
Cool that makes sense (similar to PyTorch).
Also just FYI in PyTorch we're testing currently much more than in TF mainly because we've allowed to return hidden_states and attentios. We could do the same for TF at some point
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.
Same as for PyTorch (here), with self.forward replaced with self.call
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.
The model is not relevant for the test, but not using a model from hf-internal-testing was an oversight in the previous PR :D
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.
Yes def a good idea!
model_kwargs on TF (and catch typos in generate arguments)
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.
Haha, fine with me! Can also increase all numbers otherwise
patrickvonplaten
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.
Thanks for the clean-up
293120d to
3eb5072
Compare
What does this PR do?
TF version of #18261
Adds
model_kwargsvalidation to TFgenerate, which also catches typos in the arguments. See the PR above for more details and an example of the error message users will see.Since TF had no dedicated file for
generatetests, I took the liberty to create it and move some existing tests there (>70% of the diff is due to moving things around :) ). The test for this new check was also added there.