convert_lora_to_gguf: support Qwen3.5/3.8 multimodal LoRA - #27995
convert_lora_to_gguf: support Qwen3.5/3.8 multimodal LoRA#27995the-pgh-cid wants to merge 1 commit into
Conversation
|
Hi @the-pgh-cid, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
|
Are you using the latest script? Just as in the base converter lora conversion goes through the same tensor filtering and Lines 583 to 584 in 6efc773 |
|
It is very likely that I am using an older script. Now, with pie on my face, I will head back and check and see if my brain is also plugged in, so to speak lol. thank you. I was absolutely using 9138 from a June 16 pull. My current fork supercedes my predated cuda build, and I never thought to look there first. |
Overview
Fix
convert_lora_to_gguf.pyso a LoRA trained on a Qwen3.5/3.8 multimodal base (architectureQwen3_5ForConditionalGeneration, e.g.Qwen/Qwen3.8-27B) converts to GGUF instead of failing.The failure:
ValueError: Can not map tensor 'model.language_model.layers.11.self_attn.k_proj.weight'Root cause: multimodal conditional-generation bases nest the language stack under
model.language_model.layers.N....get_base_tensor_name()strips onlybase_model.model., so the mapped name still has thelanguage_model.segment, which the base tensor map does not recognize. The base converter (convert_hf_to_gguf.py) already stripslanguage_model.when building the base GGUF; the LoRA converter never applies the same strip.The change is one line in
get_base_tensor_name:It applies only to the exact prefix the base converter already strips. Dense (non-multimodal) models have no
language_model.in their names, so they are unaffected.Additional information
Verified on
Qwen/Qwen3.8-27B: a PEFT LoRA (r=16, attention projections only) with 128 tensors converts cleanly after the fix. Before the fix the same command fails with the error above. The adapter (F16 GGUF, 21MB, 128 tensors) loads and serves against the base.Reproduction:
Requirements