Fix double lm_head mapping: NVFP4 checkpoint already uses correct names

The checkpoint has lm_head.weight and model.embed_tokens.weight
already — the suffix mappings head.weight→lm_head.weight and
embed.weight→embed_tokens.weight were incorrectly applying to keys
that already had the right prefix, producing lm_lm_head.weight.
This commit is contained in:
2026-05-19 03:54:14 +00:00
parent 4cf5b8b751
commit 909a2710e4

View File

@@ -1645,8 +1645,8 @@ def _make_deepseek_v4_nvfp4_weights_mapper() -> WeightsMapper:
},
orig_to_new_regex=expert_rename_regex,
orig_to_new_suffix={
"head.weight": "lm_head.weight",
"embed.weight": "embed_tokens.weight",
# NVFP4 checkpoint already uses lm_head.weight and
# model.embed_tokens.weight — no suffix renames needed.
".ffn.gate.bias": ".ffn.gate.e_score_correction_bias",
},
orig_to_new_substr={