Skip to content

fix(runtime): convert_qwen35.py crashes (KeyError) on tied-embedding checkpoints #219

Description

@minion1227

convert_qwen35.py unconditionally reads lm_head.weight:

write("lm_head", get("lm_head.weight").T)

When a Qwen checkpoint ties its input/output embeddings, there is no lm_head.weight tensor, so get() raises KeyError and conversion aborts.

The sibling convert_gguf.py already handles this case with a tied fallback to the input embedding (output.weight -> token_embd.weight). convert_qwen35.py should do the same: when lm_head.weight is absent, fall back to model.embed_tokens.weight (identical [vocab, hidden] layout).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions