Skip to content

Commit 8239c72

Browse files
Fix gemma4_unified model type not supported (ml-explore#1349)
Add a MODEL_REMAPPING entry for gemma4_unified → gemma4, and extend gemma4.sanitize() to skip the encoder-free vision_embedder weight prefix so the text weights load cleanly. Signed-off-by: robertlangdonn <prasad@paperd.ink>
1 parent fe468f9 commit 8239c72

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

mlx_lm/models/gemma4.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def sanitize(self, weights):
6565
"audio_tower",
6666
"embed_audio",
6767
"embed_vision",
68+
"vision_embedder", # gemma4_unified encoder-free vision
6869
)
6970
):
7071
continue

mlx_lm/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"qwen2_5_vl": "qwen2_vl",
5353
"minimax_m2": "minimax",
5454
"iquestcoder": "llama",
55+
"gemma4_unified": "gemma4", # encoder-free multimodal variant; vision/audio weights stripped by sanitize()
5556
}
5657

5758
MAX_FILE_SIZE_GB = 5

0 commit comments

Comments
 (0)