-
Notifications
You must be signed in to change notification settings - Fork 27k
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
[TokenizerFast
] Fix setting prefix space in __init__
#25563
[TokenizerFast
] Fix setting prefix space in __init__
#25563
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.
Thanks for the fix!
|
||
if add_prefix_space: | ||
pre_tok_state = pre_tok_state.replace(b'"add_prefix_space":false', b'"add_prefix_space": true') | ||
decoder_state = pre_tok_state.replace(b'"add_prefix_space":false', b'"add_prefix_space": true') |
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.
There's a type here, adding a test and a hot fix. Works alright with add_prefix_space=False
which is the default so no worries here
decoder_state = pre_tok_state.replace(b'"add_prefix_space":false', b'"add_prefix_space": true') | |
decoder_state = decoder_state.replace(b'"add_prefix_space":false', b'"add_prefix_space": true') |
…5563) * properly support Sequence of pretokenizers * actual fix * make sure the fix works. Tests are not working for sure! * hacky way * add TODO * update * add a todo
…5563) * properly support Sequence of pretokenizers * actual fix * make sure the fix works. Tests are not working for sure! * hacky way * add TODO * update * add a todo
What does this PR do?
Fixes #24846. For Sequence tokenizer, the previous solution was never doing anything.