weight_mapping: strip language_model prefix to match HF text model names

This commit is contained in:
ProofOfConcept 2026-03-30 23:11:03 -04:00
parent 6fb9735def
commit 2ecf4e21ff

View file

@ -48,10 +48,9 @@ def vllm_to_hf_views(vllm_params: dict[str, torch.Tensor]
hf_params = {} hf_params = {}
for name, tensor in vllm_params.items(): for name, tensor in vllm_params.items():
# vLLM and HF both use 'language_model.model.layers...' for Qwen3.5. # vLLM uses 'language_model.model.layers...' but HF's text model
# HF checkpoint has 'model.' prefix but named_parameters() doesn't. # uses 'model.layers...'. Strip the 'language_model.' prefix.
# Keep vLLM's names as-is — we'll match when loading into the HF model. hf_name = name.removeprefix('language_model.')
hf_name = name
# Split merged projections into HF-style separate weights # Split merged projections into HF-style separate weights
if 'in_proj_qkvz' in name: if 'in_proj_qkvz' in name: