refactor: rename num_embed to vocab_size for API consistency#576
Open
Sheshank-singh wants to merge 1 commit intogoogle-deepmind:mainfrom
Open
refactor: rename num_embed to vocab_size for API consistency#576Sheshank-singh wants to merge 1 commit intogoogle-deepmind:mainfrom
Sheshank-singh wants to merge 1 commit intogoogle-deepmind:mainfrom
Conversation
This refactoring improves API consistency by renaming the num_embed field to vocab_size across the codebase. The name vocab_size better describes the field's purpose (the vocabulary size of the model's tokenizer) and aligns with common ML framework naming conventions. Changes: - Renamed num_embed field in TransformerConfig classes to vocab_size - Updated all model configurations (Gemma2, Gemma3, Gemma3n, experimental) - Updated all usages in transformer implementations and tests - Updated research models (T5Gemma) - Updated documentation examples Closes: TODO(epot) comments in _config.py and gemma3n/_config.py Files Modified: - gemma/gm/nn/_config.py - gemma/gm/nn/_gemma.py - gemma/gm/nn/_transformer.py - gemma/gm/nn/_transformer_like.py - gemma/gm/nn/_experimental.py - gemma/gm/nn/gemma3n/_config.py - gemma/gm/nn/gemma3n/_transformer.py - gemma/gm/nn/gemma3n/_gemma3n.py - gemma/gm/testing/_dummy_model.py - gemma/research/t5gemma/config.py - gemma/research/t5gemma/modules.py - docs/research.md - All related test files
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.
This refactoring improves API consistency by renaming the num_embed field to vocab_size across the codebase. The name vocab_size better describes the field's purpose (the vocabulary size of the model's tokenizer) and aligns with common ML framework naming conventions.
Changes:
Closes: TODO(epot) comments in _config.py and gemma3n/_config.py
Files Modified: