Skip to content

[New Model] Support google/gemma-4-12B #27261

Description

@Cerdore

Support google/gemma-4-12B-it (Gemma 4 Unified).

https://huggingface.co/google/gemma-4-12B-it

Why not supported: new arch Gemma4UnifiedForConditionalGeneration /
model_type: gemma4_unified is unregistered. It's encoder-free — raw
image
patches & audio waveforms project directly into the decoder, so the existing
vision_tower/audio_tower path and weight loader don't apply.

Key points:

  • Dense decoder, 48 layers, hidden 3840 (reuse Gemma4TextModel)
  • No PLE; dual attention (sliding 1024 + full every 6th,
    global_head_dim:512)
  • Vision embedder: 48×48 patch → matmul + coord posemb → pool → 280 soft
    tokens
  • Audio embedder: 16kHz/40ms frames → linear projection
  • Needs transformers ≥ 5.10.0.dev0 for the config classes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions