immanuelpeter/Gemma4-31B-Vision
Gemma4-31B Vision
This repository packages the Tower and Projector from Gemma 4 31B.
Contents
Architecture
The RMSNorm has no learned scale, so the packaged Projector tensor is that one Linear weight.
Usage
See `examples/inference.py` for image feature extraction.
Validation
The parity script compares the 355 Tower tensors and the Projector Linear with the pinned parent using torch.equal.
Reproduction
The export script reads model.vision_tower.* (355 tensors) and model.embed_vision.* (1 tensor) from model-00001-of-00002.safetensors of google/gemma-4-31B-it. It strips the prefixes and writes the original BF16 tensors.
Credits
Google DeepMind released the Gemma 4 31B weights and the native Transformers implementation. The Gemma team also wrote a technical report that describes the vision encoder in more detail.
License
Apache License 2.0, the same license as the source model.
