mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-20 01:31:31 +02:00
apply review comments
This commit is contained in:
@@ -578,7 +578,7 @@ class DeepseekV4Model(TextModel):
|
||||
@classmethod
|
||||
def filter_tensors(cls, item: tuple[str, Callable[[], Tensor]]) -> tuple[str, Callable[[], Tensor]] | None:
|
||||
name, gen = item
|
||||
if (name.startswith(("vision.", "aligner.", "image_"))
|
||||
if (name.startswith(("aligner.", "image_"))
|
||||
or name.endswith(".ffn.gate.bias_vl")):
|
||||
return None
|
||||
if name.startswith("mtp."):
|
||||
@@ -1083,13 +1083,6 @@ class DeepseekV4FlashVisionModel(MmprojModel):
|
||||
p = self.hparams_vision["patch_size"]
|
||||
data_torch = data_torch.reshape(data_torch.shape[0], 3, p, p)
|
||||
|
||||
if ".attn.wqkv." in name:
|
||||
q, k, v = data_torch.chunk(3, dim=0)
|
||||
yield from super().modify_tensors(q, name.replace("wqkv", "wq"), bid)
|
||||
yield from super().modify_tensors(k, name.replace("wqkv", "wk"), bid)
|
||||
yield from super().modify_tensors(v, name.replace("wqkv", "wv"), bid)
|
||||
return
|
||||
|
||||
if ".mlp.w1." in name:
|
||||
# fused SwiGLU gate+up
|
||||
gate, up = data_torch.chunk(2, dim=0)
|
||||
|
||||
@@ -1583,6 +1583,7 @@ class TensorNameMap:
|
||||
),
|
||||
|
||||
MODEL_TENSOR.V_ENC_ATTN_QKV: (
|
||||
"vision.blocks.{bid}.attn.wqkv", # deepseek4v
|
||||
"visual.blocks.{bid}.attn.qkv", # qwen3vl
|
||||
"vision_tower.blocks.{bid}.attn.qkv", # dots.ocr
|
||||
"vision_encoder.blocks.{bid}.attn.qkv", # dots3note
|
||||
@@ -1594,7 +1595,6 @@ class TensorNameMap:
|
||||
),
|
||||
|
||||
MODEL_TENSOR.V_ENC_ATTN_Q: (
|
||||
"vision.blocks.{bid}.attn.wq", # deepseek4v (split from wqkv)
|
||||
"model.vision_tower.vision_model.encoder.layers.{bid}.self_attn.q_proj", # Granite4Vision
|
||||
"vision_tower.vision_model.encoder.layers.{bid}.self_attn.q_proj",
|
||||
"model.vision_tower.encoder.layers.{bid}.self_attn.q_proj", # minicpmv4_6
|
||||
@@ -1623,7 +1623,6 @@ class TensorNameMap:
|
||||
),
|
||||
|
||||
MODEL_TENSOR.V_ENC_ATTN_K: (
|
||||
"vision.blocks.{bid}.attn.wk", # deepseek4v (split from wqkv)
|
||||
"model.vision_tower.vision_model.encoder.layers.{bid}.self_attn.k_proj", # Granite4Vision
|
||||
"vision_tower.vision_model.encoder.layers.{bid}.self_attn.k_proj",
|
||||
"model.vision_tower.encoder.layers.{bid}.self_attn.k_proj", # minicpmv4_6
|
||||
@@ -1652,7 +1651,6 @@ class TensorNameMap:
|
||||
),
|
||||
|
||||
MODEL_TENSOR.V_ENC_ATTN_V: (
|
||||
"vision.blocks.{bid}.attn.wv", # deepseek4v (split from wqkv)
|
||||
"model.vision_tower.vision_model.encoder.layers.{bid}.self_attn.v_proj", # Granite4Vision
|
||||
"vision_tower.vision_model.encoder.layers.{bid}.self_attn.v_proj",
|
||||
"model.vision_tower.encoder.layers.{bid}.self_attn.v_proj", # minicpmv4_6
|
||||
|
||||
Reference in New Issue
Block a user