From 4f343aa2ccf0b8f759eaeadde7f09784c5cddfb4 Mon Sep 17 00:00:00 2001 From: Gemini Cloud AI Date: Sat, 23 May 2026 19:35:30 +0200 Subject: [PATCH] fix(qwen3): stop masking dependency ImportErrors (#2860) Co-authored-by: Gemini AI Agent --- funasr/models/qwen3_asr/model.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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