Bug: Fix weight loader error when LM head weights are tied (#3766)

This commit is contained in:
fzyzcjy
2025-02-22 09:53:12 +08:00
committed by GitHub
parent 14d90617b0
commit a3339d8cac
8 changed files with 16 additions and 0 deletions

View File

@@ -603,6 +603,8 @@ class MiniCPM3ForCausalLM(nn.Module):
# Models trained using ColossalAI may include these tensors in
# the checkpoint. Skip them.
continue
if self.config.tie_word_embeddings and "lm_head.weight" in name:
continue
for param_name, weight_name, shard_id in stacked_params_mapping:
if weight_name not in name: