Skip to content

[bugfix] fix qwen3_tts#9721

Merged
Jintao-Huang merged 2 commits into
modelscope:mainfrom
Jintao-Huang:fix_qwen3_tts_0710
Jul 10, 2026
Merged

[bugfix] fix qwen3_tts#9721
Jintao-Huang merged 2 commits into
modelscope:mainfrom
Jintao-Huang:fix_qwen3_tts_0710

Conversation

@Jintao-Huang

Copy link
Copy Markdown
Collaborator

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the loss calculation for the Qwen TTS model by removing the labels argument from the talker forward pass in swift/model/models/qwen.py and manually computing the cross-entropy loss in swift/template/templates/qwen.py. Feedback highlights a critical bug in qwen.py where the wrong hidden states layer is accessed and the batch dimension is discarded, as well as an opportunity in templates/qwen.py to scale the loss by num_items_in_batch for correct gradient scaling in distributed training.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread swift/model/models/qwen.py
Comment thread swift/template/templates/qwen.py
@Jintao-Huang
Jintao-Huang merged commit c96b7ed into modelscope:main Jul 10, 2026
2 of 3 checks passed
Jintao-Huang added a commit that referenced this pull request Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant