Skip to content

Commit 11c5dfd

Browse files
committed
Changes in convert script according to comments
1 parent 1b7f34d commit 11c5dfd

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ def set_gguf_parameters(self):
12611261
self.gguf_writer.add_vision_embedding_length(self.find_vparam(["hidden_size"]))
12621262
self.gguf_writer.add_vision_feed_forward_length(self.find_vparam(["intermediate_size"]))
12631263
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"]))
12651265

12661266
# preprocessor config
12671267
self.gguf_writer.add_vision_image_mean(self.preprocessor_config["image_mean"])
@@ -8307,9 +8307,6 @@ def prepare_tensors(self):
83078307

83088308
@ModelBase.register("CogVLMForCausalLM")
83098309
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']
83138310

83148311
def set_gguf_parameters(self):
83158312
super().set_gguf_parameters()
@@ -8338,9 +8335,6 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
83388335
class CogVLMModel(LlamaModel):
83398336
model_arch = gguf.MODEL_ARCH.COGVLM
83408337

8341-
def set_gguf_parameters(self):
8342-
super().set_gguf_parameters()
8343-
83448338
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
83458339
del bid # unused
83468340

0 commit comments

Comments
 (0)