fix(audio): resolve Qwen3-ASR forced aligner via ModelScope when it is the active source#5077
Merged
qinxuye merged 2 commits intoJun 25, 2026
Conversation
When XINFERENCE_MODEL_SRC=modelscope (or a Chinese locale), the main Qwen3-ASR weights are fetched from ModelScope, but the forced aligner (Qwen/Qwen3-ForcedAligner-0.6B) was still downloaded from Hugging Face by qwen_asr, which is typically unreachable in those environments and made model startup fail. Pre-download the aligner through the same hub and pass a local path; fall back to the original behavior on any error.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for pre-downloading the forced aligner model from ModelScope when it is configured as the active model source for Qwen3-ASR. However, a critical import error was identified in the _resolve_forced_aligner method, where retry_download is incorrectly imported from .utils instead of ..utils, which will cause the download to fail and fall back to Hugging Face.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #5059.
When starting Qwen3-ASR-1.7B / Qwen3-ASR-0.6B with
XINFERENCE_MODEL_SRC=modelscope(the common setup for users in China), the main ASR weights are correctly fetched from ModelScope byCacheManager. However, the forced aligner (Qwen/Qwen3-ForcedAligner-0.6B, configured indefault_model_config.forced_aligner) is a separate model thatqwen_asr.from_pretraineddownloads internally from Hugging Face. Hugging Face is usually unreachable in those environments, so after the main model finished downloading the load kept retrying the aligner against HF and ultimately failed to start the model.Fix
In
Qwen3ASRModel.load(), when ModelScope is the active source (download_from_modelscope()— i.e.XINFERENCE_MODEL_SRC=modelscopeor a Chinese-simplified locale), pre-download the forced aligner through ModelScope using the existingretry_downloadhelper and pass the resulting local path toqwen_asrinstead of the bare repo id.Behavior is conservative:
forced_aligneris a repo id (not an already-existing local path).None, leaving the original repo id in place soqwen_asrfalls back to exactly today's behavior. No regression path.Notes
Qwen/Qwen3-ForcedAligner-0.6Bis published on ModelScope under the same namespace as the main ASR repos (which already use the identicalmodel_idfor both hubs inmodel_spec.json), so the same id resolves on ModelScope. I don't have a ModelScope-only/offline GPU box to do a full end-to-end load, so a maintainer sanity check on a real ModelScope environment would be appreciated — the change is structured to be a no-op fallback if the aligner can't be resolved.🤖 Generated with Claude Code