Skip to content

Commit b990b99

Browse files
committed
fix convert script for glm asr & format clip-impl
1 parent 86339b0 commit b990b99

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

convert_hf_to_gguf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ def load_hparams(dir_model: Path, is_mistral_format: bool):
705705
if "llm_config" in config:
706706
# rename for InternVL
707707
config["text_config"] = config["llm_config"]
708+
if "lm_config" in config:
709+
# rename for GlmASR
710+
config["text_config"] = config["lm_config"]
708711
if "thinker_config" in config:
709712
# rename for Qwen2.5-Omni
710713
config["text_config"] = config["thinker_config"]["text_config"]
@@ -2380,7 +2383,6 @@ def prepare_tensors(self):
23802383
"VLlama3ForCausalLM",
23812384
"LlavaForConditionalGeneration",
23822385
"VoxtralForConditionalGeneration",
2383-
"GlmasrModel",
23842386
"LlamaModel")
23852387
class LlamaModel(TextModel):
23862388
model_arch = gguf.MODEL_ARCH.LLAMA
@@ -2391,6 +2393,8 @@ def __init__(self, *args, **kwargs):
23912393
# fix for SmolVLM2, missing `num_attention_heads` in config.json
23922394
if self.hf_arch == "VLlama3ForCausalLM":
23932395
self.hparams["num_attention_heads"] = self.hparams.get("num_attention_heads", 32)
2396+
hparams = ModelBase.load_hparams(self.dir_model, is_mistral_format=False)
2397+
self.origin_hf_arch = hparams.get('architectures', [None])[0]
23942398

23952399
def set_vocab(self):
23962400
if self.is_mistral_format:
@@ -2432,7 +2436,7 @@ def set_vocab(self):
24322436
# Apply to granite small models only
24332437
if self.hparams.get("vocab_size", 32000) == 49152:
24342438
self.gguf_writer.add_add_bos_token(False)
2435-
if self.hf_arch == "GlmasrModel":
2439+
if self.origin_hf_arch == "GlmasrModel":
24362440
self._set_vocab_glmedge()
24372441

24382442
def set_gguf_parameters(self):

tools/mtmd/clip-impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static std::map<projector_type, std::string> PROJECTOR_TYPE_NAMES = {
184184
{ PROJECTOR_TYPE_INTERNVL, "internvl"},
185185
{ PROJECTOR_TYPE_LLAMA4, "llama4"},
186186
{ PROJECTOR_TYPE_QWEN2A, "qwen2a"},
187-
{ PROJECTOR_TYPE_GLMA, "glma"},
187+
{ PROJECTOR_TYPE_GLMA, "glma"},
188188
{ PROJECTOR_TYPE_QWEN25O, "qwen2.5o"},
189189
{ PROJECTOR_TYPE_VOXTRAL, "voxtral"},
190190
{ PROJECTOR_TYPE_LFM2, "lfm2"},

0 commit comments

Comments
 (0)