remove tf dependency from tokenizer.py#3196
Merged
copybara-service[bot] merged 1 commit intomainfrom Feb 24, 2026
Merged
Conversation
8ae57b1 to
3638112
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
3638112 to
74232e2
Compare
74232e2 to
4b354db
Compare
|
🤖 Hi @aireenmei, I've received your request, and I'm working on it now! You can track my progress in the logs for more details. |
There was a problem hiding this comment.
This PR successfully removes the tensorflow_text dependency by consolidating SentencePieceTokenizerGrain and SentencePieceTokenizer using the native sentencepiece library. The implementation correctly handles GCS loading and transitions the tokenization operation to a unified tf.py_function approach within input_pipeline_utils.py.
🔍 General Feedback
- Simplification: Merging the two classes and moving the file logic to
gcs_utils.pysignificantly cleans up the tokenization architecture. - Testing: The unit tests have been appropriately updated to accommodate the return type change (from
tf.Tensortolist). - Completeness: The removal of
tokenizerimports intfds_data_processing_c4_mlperf.pylooks clean and accurate.
4b354db to
7f1f7e3
Compare
7f1f7e3 to
7963fc8
Compare
hengtaoguo
approved these changes
Feb 20, 2026
NicoGrande
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is part of the bigger plan of removing tensorflow dependency in MaxText
Tests
CI test
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.