Open-source speech recognition toolkit for training, inference, streaming ASR, VAD, punctuation, speaker diarization pipelines, and OpenAI-compatible/MCP serving.
Python asraudiochineseemotion-recognitionfunasrmcp-servermultilingual-asropenai-compatible-apiparaformerpunctuationpytorchreal-time-asrspeaker-diarizationspeech-recognitionspeech-to-textstreaming-asrtranscriptionvllmvoice-activity-detectionwhisper-alternative
fix(runtime): release multi-input ONNX VAD fix as 0.4.6
zhifu gao1ac1395ccde4
diff --git a/.github/workflows/test-funasr-onnx-package.yml b/.github/workflows/test-funasr-onnx-package.ymlindex 8ef0e63f0..824b2587d 100644--- a/.github/workflows/test-funasr-onnx-package.yml+++ b/.github/workflows/test-funasr-onnx-package.yml@@ -84,7 +84,7 @@ jobs:import importlib.utilfrom importlib.metadata import requires, version- assert version("funasr-onnx") == "0.4.5"+ assert version("funasr-onnx") == "0.4.6"assert importlib.util.find_spec("torch") is Nonerequirements = requires("funasr-onnx") or []@@ -125,6 +125,7 @@ jobs:if: matrix.python-version == '3.12'uses: actions/upload-artifact@v7with:- name: funasr-onnx-0.4.5+ name: funasr-onnx-0.4.6path: dist/funasr-onnx/*if-no-files-found: error+diff --git a/runtime/python/onnxruntime/README.md b/runtime/python/onnxruntime/README.mdindex daa8a6eec..bb707f431 100644--- a/runtime/python/onnxruntime/README.md+++ b/runtime/python/onnxruntime/README.md@@ -7,6 +7,11 @@ does not update the installed ONNX wrappers. Check their versions separatelywith `python -m pip show funasr-onnx funasr`; use the source installation belowwhen a required wrapper fix is newer than the published PyPI package.+Version 0.4.6 fixes offline FSMN-VAD calls with multiple inputs so each+waveform is scored independently and returns one independent result per input.+Requested batch sizes remain accepted, while the effective model batch remains 1+(#3831).+Version 0.4.5 also fixes streaming Paraformer crashes on short packets that havenot produced a feature frame yet. Buffered audio and final cache flushing arepreserved (#3827).@@ -19,9 +24,9 @@ and postprocessing fixes, not a model-weight update or an ASR accuracy claim.install from pip```shell-pip install -U "funasr-onnx>=0.4.5"+pip install -U "funasr-onnx>=0.4.6"# For the users in China, you could install with the command:-# pip install -U "funasr-onnx>=0.4.5" -i https://mirror.sjtu.edu.cn/pypi/web/simple+# pip install -U "funasr-onnx>=0.4.6" -i https://mirror.sjtu.edu.cn/pypi/web/simple# If you want to export .onnx file, you should install modelscope and funasrpip install -U modelscope funasr# For the users in China, you could install with the command:@@ -149,7 +154,7 @@ from funasr_onnx import CT_Transformermodel_dir = "damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch"model = CT_Transformer(model_dir)-text_in="跨境河流是养育沿岸人民的生命之源长期以来为帮助下游地区防灾减灾中方技术人员在上游地区极为恶劣的自然条件下克服巨大困难甚至冒着生命危险向印方提供汛期水文资料处理紧急事件中方重视印方在跨境河流问题上的关切愿意进一步完善双方联合工作机制凡是中方能做的我们都会去做而且会做得更好我请印度朋友们放心中国在上游的任何开发利用都会经过科学规划和论证兼顾上下游的利益"+text_in="è·¨å¢æ²³æµæ¯å »è²æ²¿å²¸äººæ°ççå½ä¹æºé¿æä»¥æ¥ä¸ºå¸®å©ä¸æ¸¸å°åºé²ç¾åç¾ä¸æ¹ææ¯äººåå¨ä¸æ¸¸å°åºæä¸ºæ¶å£çèªç¶æ¡ä»¶ä¸å æå·¨å¤§å°é¾çè³åççå½å±é©åå°æ¹æä¾æ±ææ°´æèµæå¤çç´§æ¥äºä»¶ä¸æ¹éè§å°æ¹å¨è·¨å¢æ²³æµé®é¢ä¸çå ³åæ¿æè¿ä¸æ¥å®ååæ¹èå工使ºå¶å¡æ¯ä¸æ¹è½åçæä»¬é½ä¼å»åèä¸ä¼å徿´å¥½æè¯·å°åº¦æå们æ¾å¿ä¸å½å¨ä¸æ¸¸çä»»ä½å¼åå©ç¨é½ä¼ç»è¿ç§å¦è§åå论è¯å ¼é¡¾ä¸ä¸æ¸¸çå©ç"result = model(text_in)print(result[0])```@@ -171,7 +176,7 @@ from funasr_onnx import CT_Transformer_VadRealtimemodel_dir = "damo/punc_ct-transformer_zh-cn-common-vad_realtime-vocab272727"model = CT_Transformer_VadRealtime(model_dir)-text_in = "跨境河流是养育沿岸|人民的生命之源长期以来为帮助下游地区防灾减灾中方技术人员|在上游地区极为恶劣的自然条件下克服巨大困难甚至冒着生命危险|向印方提供汛期水文资料处理紧急事件中方重视印方在跨境河流>问题上的关切|愿意进一步完善双方联合工作机制|凡是|中方能做的我们|都会去做而且会做得更好我请印度朋友们放心中国在上游的|任何开发利用都会经过科学|规划和论证兼顾上下游的利益"+text_in = "è·¨å¢æ²³æµæ¯å »è²æ²¿å²¸|人æ°ççå½ä¹æºé¿æä»¥æ¥ä¸ºå¸®å©ä¸æ¸¸å°åºé²ç¾åç¾ä¸æ¹ææ¯äººå|å¨ä¸æ¸¸å°åºæä¸ºæ¶å£çèªç¶æ¡ä»¶ä¸å æå·¨å¤§å°é¾çè³åççå½å±é©|åå°æ¹æä¾æ±ææ°´æèµæå¤çç´§æ¥äºä»¶ä¸æ¹éè§å°æ¹å¨è·¨å¢æ²³æµ>é®é¢ä¸çå ³å|æ¿æè¿ä¸æ¥å®ååæ¹èå工使ºå¶|塿¯|䏿¹è½åçæä»¬|é½ä¼å»åèä¸ä¼å徿´å¥½æè¯·å°åº¦æå们æ¾å¿ä¸å½å¨ä¸æ¸¸ç|ä»»ä½å¼åå©ç¨é½ä¼ç»è¿ç§å¦|è§åå论è¯å ¼é¡¾ä¸ä¸æ¸¸çå©ç"vads = text_in.split("|")rec_result_all=""@@ -200,3 +205,4 @@ Please ref to [benchmark](https://github.com/modelscope/FunASR/blob/main/runtime1. This project is maintained by [FunASR community](https://github.com/modelscope/FunASR).2. We partially refer [SWHL](https://github.com/RapidAI/RapidASR) for onnxruntime (only for paraformer model).+diff --git a/runtime/python/onnxruntime/setup.py b/runtime/python/onnxruntime/setup.pyindex f7d46687b..b205404f7 100644--- a/runtime/python/onnxruntime/setup.py+++ b/runtime/python/onnxruntime/setup.py@@ -13,7 +13,7 @@ def get_readme():MODULE_NAME = "funasr_onnx"-VERSION_NUM = "0.4.5"+VERSION_NUM = "0.4.6"setuptools.setup(name=MODULE_NAME,@@ -48,3 +48,4 @@ setuptools.setup("Programming Language :: Python :: 3.10",],)+diff --git a/tests/test_funasr_onnx_installed.py b/tests/test_funasr_onnx_installed.pyindex 10d05c184..a4d3140f3 100644--- a/tests/test_funasr_onnx_installed.py+++ b/tests/test_funasr_onnx_installed.py@@ -38,7 +38,7 @@ ENTRYPOINTS = (class InstalledOnnxPackageTest(unittest.TestCase):def test_installed_distribution_version_and_origin(self):distribution = importlib.metadata.distribution('funasr-onnx')- self.assertEqual(distribution.version, '0.4.5')+ self.assertEqual(distribution.version, '0.4.6')self.assertEqual(Path(funasr_onnx.__file__).resolve().parent,Path(distribution.locate_file('funasr_onnx')).resolve(),@@ -145,3 +145,4 @@ else:if __name__ == '__main__':unittest.main()+diff --git a/tests/test_funasr_onnx_release.py b/tests/test_funasr_onnx_release.pyindex 7f215243d..f9f26730a 100644--- a/tests/test_funasr_onnx_release.py+++ b/tests/test_funasr_onnx_release.py@@ -7,7 +7,7 @@ import unittestROOT = Path(__file__).resolve().parents[1]PACKAGE_ROOT = ROOT / "runtime" / "python" / "onnxruntime"SETUP_PATH = PACKAGE_ROOT / "setup.py"-EXPECTED_VERSION = "0.4.5"+EXPECTED_VERSION = "0.4.6"REQUIREMENT_NAME_PATTERN = re.compile(r"^\s*([A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?)")@@ -44,7 +44,7 @@ def normalized_requirement_name(requirement):class FunASROnnxReleaseContractTest(unittest.TestCase):- def test_release_version_is_0_4_5(self):+ def test_release_version_is_0_4_6(self):self.assertEqual(assigned_literal(read_setup_tree(), "VERSION_NUM"), EXPECTED_VERSION)def test_standalone_license_preserves_repository_notice(self):@@ -64,6 +64,9 @@ class FunASROnnxReleaseContractTest(unittest.TestCase):self.assertIn("does not update the installed ONNX wrappers", readme)self.assertIn("short/final VAD", readme)self.assertIn("zero-overlap", readme)+ self.assertIn("one independent result per input", readme)+ self.assertIn("effective model batch remains 1", readme)+ self.assertIn("#3831", readme)def test_runtime_dependencies_keep_onnx_install_torch_free(self):requirements = setup_keyword_literal(read_setup_tree(), "install_requires")@@ -132,3 +135,4 @@ class FunASROnnxReleaseContractTest(unittest.TestCase):if __name__ == "__main__":unittest.main()+