You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
load_safetensors: fix tensor names for Gemma 4 multimodal HF checkpoints
Public Gemma 4 checkpoints (e4b/e2b) on HuggingFace wrap the language
model under model.language_model.*, not model.* directly. Also the
per-layer token embedding is named embed_tokens_per_layer.weight with
shape [V, L*D] (not [L,V,D]), requiring a simpler matrix transpose.
- LN() prefix: model.layers.N. -> model.language_model.layers.N.
- Global tensors: model.embed_tokens.weight -> model.language_model.*
- LoadPerLayerEmbd: new name + correct [V, L*D] -> [L*D, V] transpose
Tested: 2130 tensors indexed, 42 layers loaded, prompt processing
begins (CPU-only inference is slow for 4B BF16 model).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments