Pin Gemma-4 transformers requirement to 5.5.0 stable#4784
Conversation
Gemma-4 support landed in transformers main (huggingface/transformers#45192). Update the version pin from 5.5.0.dev0 to 5.5.0 across loader, Studio version switcher, and the MLX installer. Also fix install_gemma4_mlx.sh which referenced a non-existent v5.5-release branch -- pin it to the correct commit (91b1ab1) instead.
There was a problem hiding this comment.
Code Review
This pull request updates the Transformers library version from 5.5.0.dev0 to 5.5.0 across the installation script, version utilities, and model loader. Feedback includes a suggestion to document the specific commit hash used in the installation script for better traceability and a recommendation to replace the magic version string in the model loader with a named constant to improve maintainability.
| TRANSFORMERS_WHL="transformers-5.5.0-py3-none-any.whl" | ||
| TRANSFORMERS_GH="git+https://github.com/huggingface/transformers.git@91b1ab1fdfa81a552644a92fbe3e8d88de40e167" |
There was a problem hiding this comment.
Hardcoding a specific commit hash for the transformers repository is a good practice for reproducibility, but it can make it difficult to track which version of the library is being used. Consider adding a comment explaining why this specific commit was chosen, or if possible, use a tagged release if one becomes available that includes the necessary Gemma-4 support.
| SUPPORTS_GEMMA3N = transformers_version >= Version("4.53.0") | ||
| SUPPORTS_GPTOSS = transformers_version >= Version("4.55.0") | ||
| SUPPORTS_GEMMA4 = transformers_version >= Version("5.5.0.dev0") | ||
| SUPPORTS_GEMMA4 = transformers_version >= Version("5.5.0") |
Gemma-4 support landed in transformers main (huggingface/transformers#45192). Update the version pin from 5.5.0.dev0 to 5.5.0 across loader, Studio version switcher, and the MLX installer. Also fix install_gemma4_mlx.sh which referenced a non-existent v5.5-release branch -- pin it to the correct commit (91b1ab1) instead.
Summary
5.5.0.dev0to5.5.0inunsloth/models/loader.py,studio/backend/utils/transformers_version.py, andinstall_gemma4_mlx.shinstall_gemma4_mlx.shwhich referenced a non-existentv5.5-releasebranch -- pin to commit91b1ab1fdfa81a552644a92fbe3e8d88de40e167insteadContext
Gemma-4 support has landed in transformers main (huggingface/transformers#45192). The dev0 pre-release pin is no longer needed now that 5.5.0 stable is available.
Files changed
unsloth/models/loader.py--SUPPORTS_GEMMA4version checkstudio/backend/utils/transformers_version.py--TRANSFORMERS_5_VERSIONconstantinstall_gemma4_mlx.sh-- wheel filename and git install URL