-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Replace assertion with exception #16720
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.
Wow, that's a lot of work, thanks a lot! Could you a quick search for the pattern if self.config.pad_token_id is None or logits_shape[0] != 1:
in case I missed any? The or
needs to be replaced by an and
.
Also, since it touches so many modeling files, I'd like a second review on this @LysandreJik if you can.
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.
Impressive PR! Thanks for working on it, @anmolsjoshi. Apart from Sylvain's comments, didn't find anything else that needs to be changed.
Co-authored-by: Sylvain Gugger <[email protected]>
Co-authored-by: Sylvain Gugger <[email protected]>
Co-authored-by: Sylvain Gugger <[email protected]>
Co-authored-by: Sylvain Gugger <[email protected]>
@sgugger @LysandreJik thanks for the review! I have incorporated all the requested changes. |
@sgugger unsure why the PR Documentation check is failing |
Failure is unrelated to this PR and is fixed independently. |
* Updated assertions to exceptions * updated assertions to exceptions * bug fixes * fix-copies * Update modeling_ctrl.py * Update src/transformers/models/ctrl/modeling_tf_ctrl.py Co-authored-by: Sylvain Gugger <[email protected]> * Update src/transformers/models/gpt_neo/modeling_gpt_neo.py Co-authored-by: Sylvain Gugger <[email protected]> * Update src/transformers/models/gptj/modeling_gptj.py Co-authored-by: Sylvain Gugger <[email protected]> * Update src/transformers/models/gptj/modeling_tf_gptj.py Co-authored-by: Sylvain Gugger <[email protected]> * Update modeling_led.py * Update modeling_led.py * Update modeling_led.py Co-authored-by: Sylvain Gugger <[email protected]>
What does this PR do?
Replaces assert with Exceptions as per #12789.
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
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.
@sgugger