Skip to content

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

fix(runtime): release the repaired Torch package as 0.1.4

zhifu gao73d92d53a7d2
diff --git a/runtime/python/libtorch/LICENSE b/runtime/python/libtorch/LICENSE
new file mode 100644
index 000000000..26b5e09e9
--- /dev/null
+++ b/runtime/python/libtorch/LICENSE
@@ -0,0 +1,20 @@
+MIT License
+Copyright (c) 2025 FunASR
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/runtime/python/libtorch/README.md b/runtime/python/libtorch/README.md
index 382269a49..9136bd74f 100644
--- a/runtime/python/libtorch/README.md
+++ b/runtime/python/libtorch/README.md
@@ -24,7 +24,7 @@ python -m funasr.export.export_model --model-name damo/speech_paraformer-large_a
install from pip
```shell
-pip install -U funasr_torch
+pip install -U "funasr_torch>=0.1.4"
# For the users in China, you could install with the command:
# pip install -U funasr_torch -i https://mirror.sjtu.edu.cn/pypi/web/simple
```
@@ -33,7 +33,7 @@ or install from source code
```shell
git clone https://github.com/modelscope/FunASR.git && cd FunASR
-cd funasr/runtime/python/libtorch
+cd runtime/python/libtorch
pip install -e ./
# For the users in China, you could install with the command:
# pip install -e ./ -i https://mirror.sjtu.edu.cn/pypi/web/simple
diff --git a/runtime/python/libtorch/setup.py b/runtime/python/libtorch/setup.py
index 94004ccf4..3ba4610e4 100644
--- a/runtime/python/libtorch/setup.py
+++ b/runtime/python/libtorch/setup.py
@@ -15,13 +15,14 @@ def get_readme():
setuptools.setup(
name="funasr_torch",
- version="0.1.3",
+ version="0.1.4",
platforms="Any",
url="https://github.com/modelscope/FunASR.git",
author="Speech Lab of DAMO Academy, Alibaba Group",
author_email="[email protected]",
description="FunASR: A Fundamental End-to-End Speech Recognition Toolkit",
license="The MIT License",
+ license_files=["LICENSE"],
long_description=get_readme(),
long_description_content_type="text/markdown",
include_package_data=True,
diff --git a/tests/test_funasr_torch_package.py b/tests/test_funasr_torch_package.py
index 664cbb282..ce39c8613 100644
--- a/tests/test_funasr_torch_package.py
+++ b/tests/test_funasr_torch_package.py
@@ -118,3 +118,43 @@ def test_torch_package_does_not_require_unrelated_runtime_engines(distributions)
for item in metadata(wheel).get_all("Requires-Dist", [])
}
assert not names & {"torch-quant", "onnxruntime", "onnxruntime-gpu"}
+
+def test_distribution_version_excludes_empty_published_release(distributions):
+ from packaging.version import Version
+
+ wheel, sdist = distributions
+ version = metadata(wheel)["Version"]
+ assert Version(version) >= Version("0.1.4")
+ with tarfile.open(sdist, "r:gz") as archive:
+ member = next(item for item in archive.getmembers()
+ if item.name.count("/") == 1 and item.name.endswith("/PKG-INFO"))
+ assert BytesParser().parsebytes(archive.extractfile(member).read())["Version"] == version
+
+
+def test_wheel_includes_repository_license(distributions):
+ wheel, _ = distributions
+ with zipfile.ZipFile(wheel) as archive:
+ licenses = [name for name in archive.namelist()
+ if ".dist-info/" in name and name.endswith("/LICENSE")]
+ assert len(licenses) == 1
+ assert archive.read(licenses[0]) == (ROOT / "LICENSE").read_bytes()
+ assert metadata(wheel).get_all("License-File") == ["LICENSE"]
+
+
+def test_sdist_includes_repository_license(distributions):
+ _, sdist = distributions
+ with tarfile.open(sdist, "r:gz") as archive:
+ licenses = [item for item in archive.getmembers()
+ if item.name.count("/") == 1 and item.name.endswith("/LICENSE")]
+ assert len(licenses) == 1
+ assert archive.extractfile(licenses[0]).read() == (ROOT / "LICENSE").read_bytes()
+
+
+def test_readme_source_install_directory_exists():
+ lines = (RUNTIME / "README.md").read_text().splitlines()
+ clone = lines.index("git clone https://github.com/modelscope/FunASR.git && cd FunASR")
+ command = lines[clone + 1]
+ assert command.startswith("cd ")
+ directory = ROOT / command.removeprefix("cd ")
+ assert directory.resolve() == RUNTIME.resolve()
+ assert (directory / "setup.py").is_file()