Skip to content

Commit 26b79b6

Browse files
authored
convert : fix tensor naming conflict for llama 4 vision (#13836)
* convert : fix tensor naming conflict for llama 4 vision * add comment
1 parent 1e8659e commit 26b79b6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

convert_hf_to_gguf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2169,6 +2169,9 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
21692169
# process vision tensors
21702170
if "positional_embedding_vlm" in name and ".weight" not in name:
21712171
name += ".weight"
2172+
if "multi_modal_projector.linear_1" in name:
2173+
# despite the name with number postfix, this is a single fully connected layer
2174+
return [(gguf.TENSOR_NAMES[gguf.MODEL_TENSOR.V_MMPROJ_FC], data_torch)]
21722175
return [(self.map_tensor_name(name), data_torch)]
21732176
return []
21742177

gguf-py/gguf/tensor_mapping.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,6 @@ class TensorNameMap:
902902

903903
MODEL_TENSOR.V_MMPROJ_FC: (
904904
"model.connector.modality_projection.proj", # SmolVLM
905-
"multi_modal_projector.linear_1", # llama 4
906905
),
907906

908907
MODEL_TENSOR.V_MMPROJ_MLP: (

0 commit comments

Comments
 (0)