@@ -1261,7 +1261,7 @@ def set_gguf_parameters(self):
1261
1261
self .gguf_writer .add_vision_embedding_length (self .find_vparam (["hidden_size" ]))
1262
1262
self .gguf_writer .add_vision_feed_forward_length (self .find_vparam (["intermediate_size" ]))
1263
1263
self .gguf_writer .add_vision_block_count (self .find_vparam (self .n_block_keys ))
1264
- self .gguf_writer .add_vision_head_count (self .find_vparam (["num_attention_heads" ]))
1264
+ self .gguf_writer .add_vision_head_count (self .find_vparam (["num_attention_heads" , "num_heads" ]))
1265
1265
1266
1266
# preprocessor config
1267
1267
self .gguf_writer .add_vision_image_mean (self .preprocessor_config ["image_mean" ])
@@ -8307,9 +8307,6 @@ def prepare_tensors(self):
8307
8307
8308
8308
@ModelBase .register ("CogVLMForCausalLM" )
8309
8309
class CogVLMVisionModel (MmprojModel ):
8310
- def __init__ (self , * args , ** kwargs ):
8311
- super ().__init__ (* args , ** kwargs )
8312
- self .hparams_vision ['num_attention_heads' ] = self .hparams ['num_heads' ]
8313
8310
8314
8311
def set_gguf_parameters (self ):
8315
8312
super ().set_gguf_parameters ()
@@ -8338,9 +8335,6 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
8338
8335
class CogVLMModel (LlamaModel ):
8339
8336
model_arch = gguf .MODEL_ARCH .COGVLM
8340
8337
8341
- def set_gguf_parameters (self ):
8342
- super ().set_gguf_parameters ()
8343
-
8344
8338
def modify_tensors (self , data_torch : Tensor , name : str , bid : int | None ) -> Iterable [tuple [str , Tensor ]]:
8345
8339
del bid # unused
8346
8340
0 commit comments