fix(pi05): restore tied embed tokens on load (#20)

Co-authored-by: shiki42 <shiki42@users.noreply.github.com>
这个提交包含在:
Shuyuan
2026-04-12 16:51:40 +08:00
提交者 GitHub
父节点 081d826f26
当前提交 ddb0738a76
共有 2 个文件被更改,包括 27 次插入 和 0 次删除

查看文件

@ -1097,6 +1097,14 @@ class PI05Policy(PreTrainedPolicy):
# Some checkpoints might have this, but current model expects different structure
logging.warning(f"Vision embedding key might need handling: {key}")
if (
key == "model.paligemma_with_expert.paligemma.lm_head.weight"
or key == "paligemma_with_expert.paligemma.lm_head.weight"
):
fixed_state_dict[
"model.paligemma_with_expert.paligemma.model.language_model.embed_tokens.weight"
] = value.clone()
fixed_state_dict[new_key] = value
return fixed_state_dict