@@ -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" )
23852387class 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 ):
0 commit comments