Skip to content

Commit efd4835

Browse files
committed
Added updated check for multi modal projector and vision projector in convert_hf_to_gguf.py
1 parent e92734d commit efd4835

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

convert_hf_to_gguf.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5032,11 +5032,17 @@ def set_gguf_parameters(self):
50325032
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
50335033
del bid # unused
50345034

5035+
is_vision_tensor = (
5036+
"multi_modal_projector" in name
5037+
or "vision_tower" in name
5038+
or "multimodal_projector" in name
5039+
or "vision_model" in name
5040+
)
5041+
50355042
if "language_model." in name:
50365043
name = name.replace("language_model.", "")
50375044

5038-
elif name.startswith("multi_modal_projector.") or name.startswith("vision_tower.") \
5039-
or name.startswith("multimodal_projector.") or name.startswith("vision_model."):
5045+
elif is_vision_tensor:
50405046
return [] # skip vision tensors
50415047

50425048
# remove OOV (out-of-vocabulary) rows in token_embd

0 commit comments

Comments
 (0)