Skip to content

Commit f53b313

Browse files
committed
Format changes
1 parent a9ec378 commit f53b313

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

convert_hf_to_gguf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7938,7 +7938,7 @@ def set_gguf_parameters(self):
79387938
super().set_gguf_parameters()
79397939
self.gguf_writer.add_vision_attention_layernorm_eps(self.hparams.get("layer_norm_eps", 1e-6))
79407940
self.gguf_writer.add_clip_projector_type(gguf.VisionProjectorType.COGVLM)
7941-
7941+
79427942
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
79437943
del bid # unused
79447944

@@ -7953,7 +7953,7 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
79537953
(self.map_tensor_name(name.replace("query_key_value", "key")), k),
79547954
(self.map_tensor_name(name.replace("query_key_value", "value")), v),
79557955
]
7956-
7956+
79577957
return [(self.map_tensor_name(name), data_torch)]
79587958

79597959
@ModelBase.register("CogVLMForCausalLM")
@@ -7969,7 +7969,7 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
79697969
# block vision tensors
79707970
if name.startswith("model.vision."):
79717971
return []
7972-
7972+
79737973
if "query_key_value.weight" in name:
79747974
# Slice tensor into three along first axis
79757975
q, k, v = data_torch.split(data_torch.shape[0] // 3, dim=0)

gguf-py/gguf/tensor_mapping.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ class TensorNameMap:
10171017
MODEL_TENSOR.VISEXP_ATTN_Q: (
10181018
"model.layers.{bid}.self_attn.vision_expert_query", # cogvlm
10191019
),
1020-
1020+
10211021
MODEL_TENSOR.VISEXP_ATTN_K: (
10221022
"model.layers.{bid}.self_attn.vision_expert_key", # cogvlm
10231023
),
@@ -1367,7 +1367,7 @@ class TensorNameMap:
13671367
MODEL_TENSOR.V_TOK_BOI: (
13681368
"model.vision.boi", # cogvlm
13691369
),
1370-
1370+
13711371
MODEL_TENSOR.V_TOK_EOI: (
13721372
"model.vision.eoi", # cogvlm
13731373
),

tools/mtmd/clip.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,15 +1607,14 @@ struct clip_graph {
16071607

16081608
// Apply silu
16091609
gate = ggml_silu_inplace(ctx0, gate);
1610-
1610+
16111611
// Multiply together
16121612
cur = ggml_mul(ctx0, gate, h_to_4h);
16131613

16141614
// Apply mm_4h_to_h_w
16151615
cur = ggml_mul_mat(ctx0, model.mm_4h_to_h_w, cur);
16161616

16171617
// Concatenate with boi and eoi
1618-
// TODO: The shape may be incorrect
16191618
cur = ggml_concat(ctx0, model.mm_boi, cur, 1);
16201619
cur = ggml_concat(ctx0, cur, model.mm_eoi, 1);
16211620

0 commit comments

Comments
 (0)