Skip to content

Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.

fix(qwen3): stop masking dependency ImportErrors (#2860)

Gemini Cloud AI4f343aa2ccf0
diff --git a/funasr/models/qwen3_asr/model.py b/funasr/models/qwen3_asr/model.py
index 4a494c13e..a2172b9dd 100644
--- a/funasr/models/qwen3_asr/model.py
+++ b/funasr/models/qwen3_asr/model.py
@@ -53,10 +53,13 @@ class Qwen3ASR(nn.Module):
try:
from qwen_asr import Qwen3ASRModel
- except ImportError:
- raise ImportError(
- "qwen-asr package is required. Install with: pip install qwen-asr"
- )
+ except ImportError as e:
+ # Only catch if the package itself is missing, not if its dependencies are broken
+ if "qwen_asr" in str(e):
+ raise ImportError(
+ "qwen-asr package is required. Install with: pip install qwen-asr"
+ ) from e
+ raise e
torch_dtype = self._dtype_map.get(dtype, torch.bfloat16)
fa_kwargs = None