conversion : fix Qwen3.5 MTP config lookup from text_config (fixes unslothai/unsloth#8443) - #102
Conversation
…slothai/unsloth#8443) - Merge text_config into hparams inside _QwenMtpMixin.__init__ so num_hidden_layers and mtp_num_hidden_layers are visible when nested. - Replace the bare assert with an actionable ValueError when the MTP layer count is missing and has not yet been recovered from tensors. Assisted-by: Claude Sonnet
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bc358a61e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # The count is recovered from tensor names in `filter_tensors`, which | ||
| # runs during `index_tensors` - strictly after __init__. On a cold | ||
| # process the class attribute is still 0, so the old assert gave the | ||
| # user nothing actionable. Fail with a clear message instead. |
There was a problem hiding this comment.
Avoid hard-wrapping the explanatory comment
This new comment block is split mid-sentence to fit a fixed width, and it is also more verbose than needed for the nearby code. Please either remove the extra explanation or keep any necessary sentence on a natural line so it follows the repository's comment standards.
AGENTS.md reference: AGENTS.md:L74-L81
Useful? React with 👍 / 👎.
Fixes unslothai/unsloth#8443.
Qwen3.5/3.6 HF configs may nest
num_hidden_layersandmtp_num_hidden_layersundertext_config._QwenMtpMixin.__init__only read top-level keys, so a Qwen3.5 QLoRA -> GGUF export hitassert self.opt_num_mtp_layers != 0.Changes:
text_configinto hparams inside_QwenMtpMixin.__init__, matching whatindex_tensorsalready does.ValueErrorwhen the MTP layer count is missing and has not yet been recovered from tensor names.Added regression tests in
conversion/tests/test_qwen_mtp.py.AI assistance: Claude Sonnet helped implement the fix and tests.