Skip to content

Commit 1a308da

Browse files
committed
filter out vision tensors, add missing keys
1 parent 3e623b9 commit 1a308da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

convert_hf_to_gguf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9978,6 +9978,9 @@ def __init__(self, *args, **kwargs):
99789978
for key, new_key in moe_config_map.items():
99799979
if key in moe:
99809980
config[new_key] = moe[key]
9981+
config["topk_method"] = None
9982+
config["norm_topk_prob"] = True
9983+
config["scoring_func"] = "softmax"
99819984

99829985
def set_gguf_parameters(self):
99839986
super().set_gguf_parameters()
@@ -10028,6 +10031,8 @@ def _remap_mistral_to_ds(self, name: str) -> str:
1002810031
return name
1002910032

1003010033
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None):
10034+
if name.startswith("vision_") or name.startswith("patch_merger.") or "mm_projector" in name:
10035+
return []
1003110036
name = self._remap_mistral_to_ds(name)
1003210037
return super().modify_tensors(data_torch, name, bid)
1003310038

0 commit comments

Comments
 (0)