Skip to content

Commit c40224b

Browse files
committed
follow reviewer's comment
1 parent b4f4b3c commit c40224b

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

convert_hf_to_gguf.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13377,14 +13377,14 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
1337713377
class Sarashina2VLTextModel(LlamaModel):
1337813378
model_arch = gguf.MODEL_ARCH.LLAMA
1337913379

13380-
def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None):
13380+
@classmethod
13381+
def filter_tensors(cls, item: tuple[str, Callable[[], Tensor]]) -> tuple[str, Callable[[], Tensor]] | None:
13382+
name, gen = item
1338113383
if name.startswith("llm."):
1338213384
name = name.replace("llm.", "", 1)
13383-
elif name.startswith("norm.") or name.startswith("visual."):
13384-
return
13385-
13386-
yield from super().modify_tensors(data_torch, name, bid)
13387-
13385+
elif name.startswith("norm."):
13386+
return None
13387+
return super().filter_tensors((name, gen))
1338813388

1338913389
@ModelBase.register("Sarashina2VisionForCausalLM")
1339013390
class Sarashina2VLVisionModel(Qwen2VLVisionModel):

0 commit comments

Comments
 (0)