Skip to content

fix(audio): resolve Qwen3-ASR forced aligner via ModelScope when it is the active source#5077

Merged
qinxuye merged 2 commits into
xorbitsai:mainfrom
Anai-Guo:fix/qwen3-asr-forced-aligner-modelscope
Jun 25, 2026
Merged

fix(audio): resolve Qwen3-ASR forced aligner via ModelScope when it is the active source#5077
qinxuye merged 2 commits into
xorbitsai:mainfrom
Anai-Guo:fix/qwen3-asr-forced-aligner-modelscope

Conversation

@Anai-Guo

Copy link
Copy Markdown
Contributor

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 by CacheManager. However, the forced aligner (Qwen/Qwen3-ForcedAligner-0.6B, configured in default_model_config.forced_aligner) is a separate model that qwen_asr.from_pretrained downloads 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=modelscope or a Chinese-simplified locale), pre-download the forced aligner through ModelScope using the existing retry_download helper and pass the resulting local path to qwen_asr instead of the bare repo id.

Behavior is conservative:

  • Only kicks in when the configured forced_aligner is a repo id (not an already-existing local path).
  • Only routes through ModelScope when ModelScope is the active hub — Hugging Face users are completely unaffected.
  • On any download error it logs a warning and returns None, leaving the original repo id in place so qwen_asr falls back to exactly today's behavior. No regression path.

Notes

Qwen/Qwen3-ForcedAligner-0.6B is published on ModelScope under the same namespace as the main ASR repos (which already use the identical model_id for both hubs in model_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

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.
@XprobeBot XprobeBot added bug Something isn't working gpu labels Jun 24, 2026
@XprobeBot XprobeBot added this to the v2.x milestone Jun 24, 2026

@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 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.

Comment thread xinference/model/audio/qwen3_asr.py Outdated

@qinxuye qinxuye 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.

LGTM

@qinxuye qinxuye merged commit 25fbdd9 into xorbitsai:main Jun 25, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working gpu

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2.9.0 启动 Qwen3-ASR-1.7B 去 huggingface 下载 /Qwen/Qwen3-ForcedAligner-0.6B 导致模型启动失败

3 participants