Skip multimodal/MTP checkpoint tensors absent from the text-only causal LM

Qwen3.5/3.6-MoE checkpoints ship vision (model.visual.*) and multi-token-
prediction (mtp.*) weights; the partial shard loader assigned them into the
text-only Qwen3_5MoeForCausalLM and crashed with AttributeError 'mtp'.
Filter selected tensors against the built model's state_dict keys, matching
transformers' _keys_to_ignore_on_load_unexpected behavior.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Dobromir Popov
2026-07-07 19:16:19 +02:00
parent a0dcbfbfd0
commit 471893c9d5
2 changed files with 1792 additions and 1667 deletions

File diff suppressed because it is too large Load Diff