-
Notifications
You must be signed in to change notification settings - Fork 31.7k
fix tiktoken convert to pass AddedToken to Tokenizer #36566
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
Conversation
|
Hi 👋, thank you for opening this pull request! The pull request is converted to draft by default. When it is ready for review, please click the |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
ArthurZucker
left a comment
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, can we check why the fast tests were not failing before (no gguf on the docker?)
78fc6c5 to
84b892d
Compare
7cfaf74 to
d7f52c5
Compare
ArthurZucker
left a comment
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.
Merging
* pass AddedToken to Tokenizer * ruff * handle dict for special tokens * option: test tokenizer from tiktoken same as fast * ruff * ruff
fix for #36438
Reason for the issue: that a list of tokens is expected, not a dict of tokens / ids, which is what tiktoken's encoding_name_for_model provides. This converter function was designed for more 'behind the scenes' use I guess, but we can make this fix to support it better for direct use.
We don't explicitly test convert_slow_tokenizer, so we can test equivalence for gpt2 (since it's common between tiktoken and transformers)