[BugFix][VLM] Correct weight loading with tie_word_embeddings == False (#15398)
This commit is contained in:
@@ -783,7 +783,11 @@ class Qwen2_5_VLForConditionalGeneration(nn.Module):
|
|||||||
if "rotary_emb.inv_freq" in name:
|
if "rotary_emb.inv_freq" in name:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if self.pp_group.is_last_rank and "model.embed_tokens.weight" in name:
|
if (
|
||||||
|
self.config.tie_word_embeddings
|
||||||
|
and self.pp_group.is_last_rank
|
||||||
|
and "model.embed_tokens.weight" in name
|
||||||
|
):
|
||||||
if "lm_head.weight" in params_dict:
|
if "lm_head.weight" in params_dict:
|
||||||
lm_head_param = params_dict["lm_head.weight"]
|
lm_head_param = params_dict["lm_head.weight"]
|
||||||
weight_loader = getattr(
|
weight_loader = getattr(
|
||||||
|
|||||||
Reference in New Issue
Block a user