Skip to content

Commit 3ce96d7

Browse files
committed
fix conversion
1 parent 3bbb26b commit 3ce96d7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

convert_hf_to_gguf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5989,7 +5989,7 @@ def __init__(self, *args, **kwargs):
59895989
self.hparams["image_size"] = self.hparams["num_mel_bins"]
59905990
self.hparams["patch_size"] = self.hparams["num_mel_bins"]
59915991
self.hparams["hidden_size"] = self.hparams["d_model"]
5992-
self.hparams["intermediate_size"] = self.hparams["d_model"]
5992+
self.hparams["intermediate_size"] = self.hparams["encoder_ffn_dim"]
59935993
self.hparams["num_attention_heads"] = self.hparams["encoder_attention_heads"]
59945994
self.preprocessor_config["image_mean"] = [0, 0, 0]
59955995
self.preprocessor_config["image_std"] = [0, 0, 0]
@@ -6009,6 +6009,10 @@ def tensor_force_quant(self, name, new_name, bid, n_dims):
60096009
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
60106010
del bid # unused
60116011

6012+
# prevent clash naming with vision tensors
6013+
if name.startswith("multi_modal_projector"):
6014+
name = "audio." + name
6015+
60126016
if "conv1.bias" in name or "conv2.bias" in name:
60136017
# transpose conv1 and conv2 bias
60146018
data_torch = data_torch.unsqueeze(-1)

gguf-py/gguf/tensor_mapping.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,15 +1162,15 @@ class TensorNameMap:
11621162
),
11631163

11641164
MODEL_TENSOR.A_MMPROJ: (
1165-
"multi_modal_projector.linear_{bid}", # ultravox
1165+
"audio.multi_modal_projector.linear_{bid}", # ultravox
11661166
),
11671167

11681168
MODEL_TENSOR.A_MM_NORM_PRE: (
1169-
"multi_modal_projector.ln_pre", # ultravox
1169+
"audio.multi_modal_projector.ln_pre", # ultravox
11701170
),
11711171

11721172
MODEL_TENSOR.A_MM_NORM_MID: (
1173-
"multi_modal_projector.ln_mid", # ultravox
1173+
"audio.multi_modal_projector.ln_mid", # ultravox
11741174
),
11751175
}
11761176

0 commit comments

Comments
 (0)