-
Notifications
You must be signed in to change notification settings - Fork 25.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
Assertions to exceptions #13692
Assertions to exceptions #13692
Conversation
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.
Thank you for fixing this!
Could you run make style
and make quality
from the root of the repo? That should fix the failing test.
Raise exceptions instead of using assertions for control flow Co-authored-by: Suraj Patil <surajp815@gmail.com>
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 fixing!
Raise exceptions instead of using assertions for control flow Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Note that you still need to run |
Thank you so much, will do! |
Yes, this is my first time contributing to a PR, so I'm sorry if I'm being a little slow. I have run the 'make style', hoping it passes this time. And thanks for approving the changes :) |
No problem, we all have to learn and start somewhere :-) |
* Raise exceptions instead of using assertions for control flow huggingface#12789 * # coding=utf-8 * Raise exceptions instead of using assertions for control flow * Raise exceptions instead of using assertions for control flow * Update src/transformers/tokenization_utils.py Raise exceptions instead of using assertions for control flow Co-authored-by: Suraj Patil <surajp815@gmail.com> * Update src/transformers/tokenization_utils.py Raise exceptions instead of using assertions for control flow Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * Raise exceptions instead of using assertions for control flow * test * Raise exceptions instead of using assertions for control flow Co-authored-by: MocktaiLEngineer <kavinarasu22@gmail.com> Co-authored-by: Suraj Patil <surajp815@gmail.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Raise exceptions instead of using assertions for control flow huggingface#12789 * # coding=utf-8 * Raise exceptions instead of using assertions for control flow * Raise exceptions instead of using assertions for control flow * Update src/transformers/tokenization_utils.py Raise exceptions instead of using assertions for control flow Co-authored-by: Suraj Patil <surajp815@gmail.com> * Update src/transformers/tokenization_utils.py Raise exceptions instead of using assertions for control flow Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * Raise exceptions instead of using assertions for control flow * test * Raise exceptions instead of using assertions for control flow Co-authored-by: MocktaiLEngineer <kavinarasu22@gmail.com> Co-authored-by: Suraj Patil <surajp815@gmail.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* Raise exceptions instead of using assertions for control flow huggingface#12789 * # coding=utf-8 * Raise exceptions instead of using assertions for control flow * Raise exceptions instead of using assertions for control flow * Update src/transformers/tokenization_utils.py Raise exceptions instead of using assertions for control flow Co-authored-by: Suraj Patil <surajp815@gmail.com> * Update src/transformers/tokenization_utils.py Raise exceptions instead of using assertions for control flow Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * Raise exceptions instead of using assertions for control flow * test * Raise exceptions instead of using assertions for control flow Co-authored-by: MocktaiLEngineer <kavinarasu22@gmail.com> Co-authored-by: Suraj Patil <surajp815@gmail.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
What does this PR do?
This PR addresses the issue #12789
I have modified the file transformers/src/transformers/tokenization_utils.py file to throw a type error instead of assertions.
Fixes # (issue)
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.