Skip to content

Commit 6bc2158

Browse files
committed
Format changes
1 parent c289ef1 commit 6bc2158

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
@@ -7848,7 +7848,7 @@ def set_gguf_parameters(self):
78487848
super().set_gguf_parameters()
78497849
self.gguf_writer.add_vision_attention_layernorm_eps(self.hparams.get("layer_norm_eps", 1e-6))
78507850
self.gguf_writer.add_clip_projector_type(gguf.VisionProjectorType.COGVLM)
7851-
7851+
78527852
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
78537853
del bid # unused
78547854

@@ -7863,7 +7863,7 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
78637863
(self.map_tensor_name(name.replace("query_key_value", "key")), k),
78647864
(self.map_tensor_name(name.replace("query_key_value", "value")), v),
78657865
]
7866-
7866+
78677867
return [(self.map_tensor_name(name), data_torch)]
78687868

78697869
@ModelBase.register("CogVLMForCausalLM")
@@ -7879,7 +7879,7 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
78797879
# block vision tensors
78807880
if name.startswith("model.vision."):
78817881
return []
7882-
7882+
78837883
if "query_key_value.weight" in name:
78847884
# Slice tensor into three along first axis
78857885
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
@@ -1005,7 +1005,7 @@ class TensorNameMap:
10051005
MODEL_TENSOR.VISEXP_ATTN_Q: (
10061006
"model.layers.{bid}.self_attn.vision_expert_query", # cogvlm
10071007
),
1008-
1008+
10091009
MODEL_TENSOR.VISEXP_ATTN_K: (
10101010
"model.layers.{bid}.self_attn.vision_expert_key", # cogvlm
10111011
),
@@ -1355,7 +1355,7 @@ class TensorNameMap:
13551355
MODEL_TENSOR.V_TOK_BOI: (
13561356
"model.vision.boi", # cogvlm
13571357
),
1358-
1358+
13591359
MODEL_TENSOR.V_TOK_EOI: (
13601360
"model.vision.eoi", # cogvlm
13611361
),

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)