fix(qwen3_moe): correct return type annotation on Qwen3MoeSparseMoeBlock.forward#45352
Conversation
|
@RudrenduPaul can you run |
|
Hi @Rocketknight1 — ran ✅ (3 checks failed due to missing local packages — The branch is also up to date with main (the upstream sync from the 'Update branch' button is already included). Ready for your final review whenever you're free — thanks! |
…rated vl_moe and omni_moe files Built by Rudrendu Paul, developed with Claude Code
|
@Rocketknight1 — follow-up on the The CI diff showed the modular conversion of Just pushed a second commit propagating the fix to:
(Left Should be ready for final review now! |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: qwen3_moe, qwen3_omni_moe, qwen3_vl_moe |
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
…ock.forward (huggingface#45352) * fix(qwen3_moe): correct return type annotation on Qwen3MoeSparseMoeBlock.forward * fix: propagate Qwen3MoeSparseMoeBlock forward return type fix to generated vl_moe and omni_moe files Built by Rudrendu Paul, developed with Claude Code --------- Co-authored-by: Rudrendu <RudrenduPaul@users.noreply.github.com>
What does this PR do?
Corrects an incorrect return type annotation on
Qwen3MoeSparseMoeBlock.forward.The method is annotated as returning
tuple[torch.Tensor, torch.Tensor]but actually returns a single reshapedtorch.Tensor(see thereturn final_hidden_states.reshape(...)statement). This type mismatch was identified in issue #45208 and confirmed by maintainer @Rocketknight1.Fixes #45208
Changes
src/transformers/models/qwen3_moe/modular_qwen3_moe.py: Fix return type annotation fromtuple[torch.Tensor, torch.Tensor]totorch.Tensorsrc/transformers/models/qwen3_moe/modeling_qwen3_moe.py: Same fix in the generated file (kept in sync with the modular file)Tests
No functional change — annotation-only fix. Existing tests continue to pass.
This is not a duplicate of PR #45211 (which was opened and closed without review before the maintainer commented on the issue).