Skip to content

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

fix(auto-model): report vda model typo (#3443)

zhifu gao60827ffbeba5
diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py
index 2581ee0b7..f24506b6f 100644
--- a/funasr/auto/auto_model.py
+++ b/funasr/auto/auto_model.py
@@ -421,6 +421,11 @@ class AutoModel:
>>> model = AutoModel(model="FunAudioLLM/Fun-ASR-Nano-2512", trust_remote_code=True,
... remote_code="./model.py", vad_model="fsmn-vad", spk_model="cam++", hub="hf")
"""
+ if "vda_model" in kwargs:
+ raise TypeError(
+ "`vda_model` is not a valid AutoModel argument; use `vad_model` to enable voice activity detection."
+ )
+
try:
from funasr.utils.version_checker import check_for_update
diff --git a/tests/test_auto_model.py b/tests/test_auto_model.py
index 5418c3288..399dc5123 100644
--- a/tests/test_auto_model.py
+++ b/tests/test_auto_model.py
@@ -23,6 +23,13 @@ class TestAutoModel(unittest.TestCase):
"disable_update": True,
}
+ def test_vda_model_typo_reports_vad_model_parameter(self):
+ with self.assertRaisesRegex(
+ TypeError,
+ r"`vda_model`.*`vad_model`",
+ ):
+ AutoModel(vda_model="fsmn-vad", disable_update=True)
+
def test_merge_thr_in_cb_model(self):
kwargs = self.base_kwargs.copy()
kwargs["spk_model"] = "cam++"