Skip to content

Commit a203b4a

Browse files
author
jarvis
committed
convert: skip vision tensors in NVFP4 text-model path
The MmprojModel branch already skipped non-vision tensors. The inverse case was missing: when processing the text body of a VLM (e.g. Qwopus3.6 Qwen3_5ForConditionalGeneration) that has NVFP4-quantized weights, the visual.* tensors flow through _generate_nvfp4_tensors -> map_tensor_name and crash with "Can not map tensor model.visual.blocks.0.attn.proj.weight". Mirror the MmprojModel skip on text models so visual tensors are left for the --mmproj pass.
1 parent bb05a05 commit a203b4a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

convert_hf_to_gguf.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,15 @@ def _generate_nvfp4_tensors(self):
654654
or "vision_model" in name
655655
):
656656
continue
657+
# Inverse: when processing text model, skip vision tensors that
658+
# NVFP4 packing cannot route via the LLM tensor name map.
659+
if not isinstance(self, MmprojModel) and (
660+
name.startswith("model.visual")
661+
or name.startswith("visual.")
662+
or "vision_tower" in name
663+
or "vision_model" in name
664+
):
665+
continue
657666
scale_name = name.replace(".weight", ".weight_scale")
658667
scale2_name = name.replace(".weight", ".weight_scale_2")
659668
input_scale_name = name.replace(".weight", ".input_scale")

0 commit comments

Comments
 (0)