Skip to content
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

Add from_slow in fast tokenizers build and fixes some bugs #9987

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

sgugger
Copy link
Collaborator

@sgugger sgugger commented Feb 3, 2021

What does this PR do?

This PR adds an argument to the initialization of the PreTrainedTokenizerFast to force the conversion from a slow tokenizer. This will be useful to help users re-build the tokenizer.json file for some models where we can't update faulty ones right now without breaking backward compatibility (see #9637).

In passing it fixes a few bugs:

  • wrong formatting for the documentation
  • the fast sentencepiece tokenziers don't have an sp_model attribute so remove the documentation for that
  • BarthezTokenizerFast was not registered properly in the autotokenizers, so AutoTokenizer was not finding it

@sgugger sgugger requested review from n1t0 and LysandreJik February 3, 2021 21:01
Copy link
Member

@n1t0 n1t0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I say yes!!!

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for applying these changes. They look good to me!

@LysandreJik LysandreJik merged commit 7898fc0 into master Feb 4, 2021
@LysandreJik LysandreJik deleted the tokenizer_from_slow branch February 4, 2021 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants