diff --git a/.github/workflows/test-funasr-onnx-package.yml b/.github/workflows/test-funasr-onnx-package.yml index ed0be20c9..f94b86e09 100644 --- a/.github/workflows/test-funasr-onnx-package.yml +++ b/.github/workflows/test-funasr-onnx-package.yml @@ -13,6 +13,7 @@ on: - "tests/test_funasr_onnx_paraformer_online_empty_final.py" - "tests/test_funasr_onnx_vad_online_short_chunks.py" - "tests/test_funasr_onnx_vad_multiple_inputs.py" + - "tests/test_funasr_onnx_punctuation_empty_input.py" - "tests/test_rich_transcription_postprocess.py" - "tests/test_rich_transcription_event_segments.py" push: @@ -29,6 +30,7 @@ on: - "tests/test_funasr_onnx_paraformer_online_empty_final.py" - "tests/test_funasr_onnx_vad_online_short_chunks.py" - "tests/test_funasr_onnx_vad_multiple_inputs.py" + - "tests/test_funasr_onnx_punctuation_empty_input.py" - "tests/test_rich_transcription_postprocess.py" - "tests/test_rich_transcription_event_segments.py" workflow_dispatch: @@ -84,7 +86,7 @@ jobs: import importlib.util from importlib.metadata import requires, version - assert version("funasr-onnx") == "0.4.8" + assert version("funasr-onnx") == "0.4.9" assert importlib.util.find_spec("torch") is None requirements = requires("funasr-onnx") or [] @@ -115,6 +117,9 @@ jobs: - name: Verify offline VAD results per input run: python tests/test_funasr_onnx_vad_multiple_inputs.py + - name: Verify empty punctuation streaming cache + run: python tests/test_funasr_onnx_punctuation_empty_input.py + - name: Verify source distribution error paths run: | python -m pip install --force-reinstall --no-deps dist/funasr-onnx/*.tar.gz @@ -125,7 +130,7 @@ jobs: if: matrix.python-version == '3.12' uses: actions/upload-artifact@v7 with: - name: funasr-onnx-0.4.8 + name: funasr-onnx-0.4.9 path: dist/funasr-onnx/* if-no-files-found: error diff --git a/runtime/python/onnxruntime/README.md b/runtime/python/onnxruntime/README.md index 3db16c02d..8794ac4c7 100644 --- a/runtime/python/onnxruntime/README.md +++ b/runtime/python/onnxruntime/README.md @@ -7,6 +7,12 @@ does not update the installed ONNX wrappers. Check their versions separately with `python -m pip show funasr-onnx funasr`; use the source installation below when a required wrapper fix is newer than the published PyPI package. +Version 0.4.9 keeps one result per input when offline VAD receives empty or sub-frame +audio, without invoking ONNX Runtime for zero-frame features (#3846). It also returns +an empty punctuation chunk while it preserves the streaming cache and avoids +tokenization and inference (#3847). These are CPU runtime-wrapper fixes, not a +model-weight or ASR accuracy update. + Version 0.4.8 makes the standalone CMVN reader accept blank lines and raise a file-specific error for missing or truncated statistics (#3842). Valid float64 statistics and shipped feature output are unchanged. This is @@ -33,9 +39,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.8" +pip install -U "funasr-onnx>=0.4.9" # For the users in China, you could install with the command: -# pip install -U "funasr-onnx>=0.4.8" -i https://mirror.sjtu.edu.cn/pypi/web/simple +# pip install -U "funasr-onnx>=0.4.9" -i https://mirror.sjtu.edu.cn/pypi/web/simple # If you want to export .onnx file, you should install modelscope and funasr pip install -U modelscope funasr # For the users in China, you could install with the command: diff --git a/runtime/python/onnxruntime/setup.py b/runtime/python/onnxruntime/setup.py index dd3dc9abb..b5236ffc1 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.8" +VERSION_NUM = "0.4.9" setuptools.setup( name=MODULE_NAME, diff --git a/tests/test_funasr_onnx_installed.py b/tests/test_funasr_onnx_installed.py index 3b479dcc9..4b3c254ee 100644 --- a/tests/test_funasr_onnx_installed.py +++ b/tests/test_funasr_onnx_installed.py @@ -38,7 +38,7 @@ class InstalledOnnxPackageTest(unittest.TestCase): def test_installed_distribution_version_and_origin(self): distribution = importlib.metadata.distribution('funasr-onnx') - self.assertEqual(distribution.version, '0.4.8') + self.assertEqual(distribution.version, '0.4.9') self.assertEqual( Path(funasr_onnx.__file__).resolve().parent, Path(distribution.locate_file('funasr_onnx')).resolve(), diff --git a/tests/test_funasr_onnx_release.py b/tests/test_funasr_onnx_release.py index 28593257d..160c24aa4 100644 --- a/tests/test_funasr_onnx_release.py +++ b/tests/test_funasr_onnx_release.py @@ -7,7 +7,7 @@ ROOT = Path(__file__).resolve().parents[1] PACKAGE_ROOT = ROOT / "runtime" / "python" / "onnxruntime" SETUP_PATH = PACKAGE_ROOT / "setup.py" -EXPECTED_VERSION = "0.4.8" +EXPECTED_VERSION = "0.4.9" 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_8(self): + def test_release_version_is_0_4_9(self): self.assertEqual(assigned_literal(read_setup_tree(), "VERSION_NUM"), EXPECTED_VERSION) def test_standalone_license_preserves_repository_notice(self): @@ -58,6 +58,12 @@ def test_workflow_checks_and_artifact_use_release_version(self): self.assertIn(f'assert version("funasr-onnx") == "{EXPECTED_VERSION}"', workflow) self.assertIn(f"name: funasr-onnx-{EXPECTED_VERSION}", workflow) + def test_workflow_collects_empty_punctuation_regression(self): + workflow = (ROOT / ".github/workflows/test-funasr-onnx-package.yml").read_text() + test_path = "tests/test_funasr_onnx_punctuation_empty_input.py" + self.assertEqual(workflow.count(test_path), 3) + self.assertIn("python " + test_path, workflow) + def test_readme_names_the_standalone_fix_release(self): readme = (PACKAGE_ROOT / "README.md").read_text() self.assertIn(f'pip install -U "funasr-onnx>={EXPECTED_VERSION}"', readme) @@ -71,6 +77,10 @@ def test_readme_names_the_standalone_fix_release(self): self.assertIn("hotword", readme) self.assertIn("#3842", readme) self.assertIn("CMVN", readme) + self.assertIn("#3846", readme) + self.assertIn("#3847", readme) + self.assertIn("empty or sub-frame", readme) + self.assertIn("preserves the streaming cache", readme) def test_runtime_dependencies_keep_onnx_install_torch_free(self): requirements = setup_keyword_literal(read_setup_tree(), "install_requires")