-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Chore] Use tokenizer.encode and tokenizer.decode directly
#29851
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
[Chore] Use tokenizer.encode and tokenizer.decode directly
#29851
Conversation
Signed-off-by: DarkLight1337 <[email protected]>
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.
Code Review
This pull request is a good refactoring effort to standardize the tokenizer interface by replacing encode_tokens and decode_tokens with direct calls to tokenizer.encode and tokenizer.decode. The changes are mostly correct and the deprecation of the old functions is appropriate. However, I've identified a critical bug in one of the test files where an incorrect number of arguments is passed to tokenizer.encode, which will cause the test to fail.
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]> (cherry picked from commit 68ffbca)
Purpose
Now that we have standardized the Tokenizer interface, we can replace
encode_tokensanddecode_tokenswithtokenizer.encodeandtokenizer.decoderespectively.Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.