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: include runtime package data (#3445)
zhifu gao135915179459
diff --git a/setup.py b/setup.pyindex 066137e3a..7875d77e3 100644--- a/setup.py+++ b/setup.py@@ -140,7 +140,16 @@ setup(long_description_content_type="text/markdown",license="The MIT License",packages=find_packages(include=["funasr*"]),- package_data={"funasr": ["version.txt"]},+ package_data={+ "funasr": [+ "version.txt",+ "models/sense_voice/whisper_lib/normalizers/english.json",+ "models/rwkv_bat/cuda_encoder/*.cpp",+ "models/rwkv_bat/cuda_encoder/*.cu",+ "models/rwkv_bat/cuda_decoder/*.cpp",+ "models/rwkv_bat/cuda_decoder/*.cu",+ ]+ },install_requires=install_requires,setup_requires=setup_requires,tests_require=tests_require,diff --git a/tests/test_release_package_data.py b/tests/test_release_package_data.pynew file mode 100644index 000000000..f849b2b70--- /dev/null+++ b/tests/test_release_package_data.py@@ -0,0 +1,34 @@+from pathlib import Path+import subprocess+import sys+from zipfile import ZipFile+++ROOT = Path(__file__).resolve().parents[1]+RUNTIME_PACKAGE_FILES = {+ "funasr/models/sense_voice/whisper_lib/normalizers/english.json",+ "funasr/models/rwkv_bat/cuda_encoder/wkv_cuda.cu",+ "funasr/models/rwkv_bat/cuda_encoder/wkv_op.cpp",+ "funasr/models/rwkv_bat/cuda_decoder/wkv_cuda.cu",+ "funasr/models/rwkv_bat/cuda_decoder/wkv_op.cpp",+}+++def test_wheel_includes_runtime_package_data(tmp_path):+ subprocess.run(+ [+ sys.executable,+ "-c",+ "import sys; from setuptools import build_meta; "+ "build_meta.build_wheel(sys.argv[1])",+ str(tmp_path),+ ],+ check=True,+ cwd=ROOT,+ )+ [wheel_path] = tmp_path.glob("*.whl")++ with ZipFile(wheel_path) as wheel:+ wheel_files = set(wheel.namelist())++ assert RUNTIME_PACKAGE_FILES <= wheel_files