-
Notifications
You must be signed in to change notification settings - Fork 27.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
Warning about too long input for fast tokenizers too #8799
Warning about too long input for fast tokenizers too #8799
Conversation
Failing tests seem to come from some other code (seq2seq) |
""" | ||
Clean up a list of simple English tokenization artifacts like spaces before punctuations and abbreviated forms. | ||
clean up a list of simple english tokenization artifacts like spaces before punctuations and abbreviated forms. | ||
|
||
Args: | ||
out_string (:obj:`str`): The text to clean up. | ||
args: out_string (:obj:`str`): the text to clean up. | ||
|
||
Returns: | ||
:obj:`str`: The cleaned-up string. | ||
returns: :obj:`str`: the cleaned-up string. |
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 docstring was in the correct style before the 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.
But I simply ran the documentation fixer :(
@thomwolf could you review this PR as you're the mastermind behind this code? |
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.
LGTM
If truncation is not set in tokenizers, but the tokenization is too long for the model (`model_max_length`), we used to trigger a warning that The input would probably fail (which it most likely will). This PR re-enables the warning for fast tokenizers too and uses common code for the trigger to make sure it's consistent across.
201db80
to
a4ecb3a
Compare
@LysandreJik May I merge (failing tests and quality is linked to unrelated |
What does this PR do?
If truncation is not set in tokenizers, but the tokenization is too long
for the model (
model_max_length
), we used to trigger a warning thatThe input would probably fail (which it most likely will).
This PR re-enables the warning for fast tokenizers too and uses common code
for the trigger to make sure it's consistent across.
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 which may be interested in your PR.
@LysandreJik
@thomwolf