Skip to content

Commit c2cac26

Browse files
[DeepSeekV4] fix MTP embedding AOA marker (#4703)
1 parent 457e217 commit c2cac26

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

paddleformers/transformers/deepseek_v4/modeling.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,8 @@ def _gen_aoa_config(cls, config: DeepseekV4Config):
415415
"embed.weight -> model.embedding.embed_tokens.weight",
416416
"norm.weight -> model.norm.weight",
417417
]
418+
if mtp_num_layers > 0:
419+
stmts.append("embed.weight -> model.mtp_embedding.embed_tokens.weight")
418420
if config.tie_word_embeddings:
419421
stmts += ["embed.weight -> model.lm_head.weight"]
420422
else:
@@ -711,6 +713,8 @@ def _gen_inv_aoa_config(cls, config: DeepseekV4Config):
711713
"model.embedding.embed_tokens.weight -> embed.weight",
712714
"model.norm.weight -> norm.weight",
713715
]
716+
if mtp_num_layers > 0:
717+
stmts.append("model.mtp_embedding.embed_tokens.weight -> embed.weight")
714718
if config.tie_word_embeddings:
715719
stmts += ["model.lm_head.weight -> _"]
716720
else:

0 commit comments

Comments
 (0)