Committed by
GitHub
Refactor CI tests (#2504)
This PR refactors CI test configurations by removing pull request triggers from multiple GitHub Actions workflows and fixes a bug in the cosine similarity calculation. Additionally, it updates Python version paths for newer 3.13.6 release.
正在显示
40 个修改的文件
包含
21 行增加
和
395 行删除
| @@ -13,15 +13,6 @@ on: | @@ -13,15 +13,6 @@ on: | ||
| 13 | - 'sherpa-onnx/csrc/*' | 13 | - 'sherpa-onnx/csrc/*' |
| 14 | - 'sherpa-onnx/c-api/*' | 14 | - 'sherpa-onnx/c-api/*' |
| 15 | - 'toolchains/aarch64-linux-gnu.toolchain.cmake' | 15 | - 'toolchains/aarch64-linux-gnu.toolchain.cmake' |
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/aarch64-linux-gnu-shared.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'sherpa-onnx/c-api/*' | ||
| 24 | - - 'toolchains/aarch64-linux-gnu.toolchain.cmake' | ||
| 25 | 16 | ||
| 26 | workflow_dispatch: | 17 | workflow_dispatch: |
| 27 | 18 |
| @@ -13,15 +13,6 @@ on: | @@ -13,15 +13,6 @@ on: | ||
| 13 | - 'sherpa-onnx/csrc/*' | 13 | - 'sherpa-onnx/csrc/*' |
| 14 | - 'sherpa-onnx/c-api/*' | 14 | - 'sherpa-onnx/c-api/*' |
| 15 | - 'toolchains/aarch64-linux-gnu.toolchain.cmake' | 15 | - 'toolchains/aarch64-linux-gnu.toolchain.cmake' |
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/aarch64-linux-gnu-static.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'sherpa-onnx/c-api/*' | ||
| 24 | - - 'toolchains/aarch64-linux-gnu.toolchain.cmake' | ||
| 25 | 16 | ||
| 26 | workflow_dispatch: | 17 | workflow_dispatch: |
| 27 | 18 |
| @@ -12,15 +12,6 @@ on: | @@ -12,15 +12,6 @@ on: | ||
| 12 | - 'build-android*.sh' | 12 | - 'build-android*.sh' |
| 13 | tags: | 13 | tags: |
| 14 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 14 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 15 | - pull_request: | ||
| 16 | - branches: | ||
| 17 | - - master | ||
| 18 | - paths: | ||
| 19 | - - '.github/workflows/android-rknn.yaml' | ||
| 20 | - - 'cmake/**' | ||
| 21 | - - 'sherpa-onnx/csrc/*' | ||
| 22 | - - 'sherpa-onnx/jni/*' | ||
| 23 | - - 'build-android*.sh' | ||
| 24 | 15 | ||
| 25 | workflow_dispatch: | 16 | workflow_dispatch: |
| 26 | 17 |
| @@ -15,15 +15,6 @@ on: | @@ -15,15 +15,6 @@ on: | ||
| 15 | - 'build-android*.sh' | 15 | - 'build-android*.sh' |
| 16 | tags: | 16 | tags: |
| 17 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 17 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 18 | - pull_request: | ||
| 19 | - branches: | ||
| 20 | - - master | ||
| 21 | - paths: | ||
| 22 | - - '.github/workflows/android-static.yaml' | ||
| 23 | - - 'cmake/**' | ||
| 24 | - - 'sherpa-onnx/csrc/*' | ||
| 25 | - - 'sherpa-onnx/jni/*' | ||
| 26 | - - 'build-android*.sh' | ||
| 27 | 18 | ||
| 28 | workflow_dispatch: | 19 | workflow_dispatch: |
| 29 | 20 |
| @@ -12,15 +12,6 @@ on: | @@ -12,15 +12,6 @@ on: | ||
| 12 | - 'build-android*.sh' | 12 | - 'build-android*.sh' |
| 13 | tags: | 13 | tags: |
| 14 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 14 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 15 | - pull_request: | ||
| 16 | - branches: | ||
| 17 | - - master | ||
| 18 | - paths: | ||
| 19 | - - '.github/workflows/android.yaml' | ||
| 20 | - - 'cmake/**' | ||
| 21 | - - 'sherpa-onnx/csrc/*' | ||
| 22 | - - 'sherpa-onnx/jni/*' | ||
| 23 | - - 'build-android*.sh' | ||
| 24 | 15 | ||
| 25 | workflow_dispatch: | 16 | workflow_dispatch: |
| 26 | 17 |
| @@ -13,15 +13,6 @@ on: | @@ -13,15 +13,6 @@ on: | ||
| 13 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' | 13 | - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' |
| 14 | tags: | 14 | tags: |
| 15 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 15 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/arm-linux-gnueabihf.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'sherpa-onnx/c-api/*' | ||
| 24 | - - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' | ||
| 25 | 16 | ||
| 26 | workflow_dispatch: | 17 | workflow_dispatch: |
| 27 | 18 |
| @@ -13,16 +13,6 @@ on: | @@ -13,16 +13,6 @@ on: | ||
| 13 | - 'sherpa-onnx/c-api/*' | 13 | - 'sherpa-onnx/c-api/*' |
| 14 | tags: | 14 | tags: |
| 15 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 15 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - './build-ios.sh' | ||
| 21 | - - '.github/workflows/build-xcframework.yaml' | ||
| 22 | - - 'CMakeLists.txt' | ||
| 23 | - - 'cmake/**' | ||
| 24 | - - 'sherpa-onnx/csrc/*' | ||
| 25 | - - 'sherpa-onnx/c-api/*' | ||
| 26 | 16 | ||
| 27 | workflow_dispatch: | 17 | workflow_dispatch: |
| 28 | 18 |
| @@ -13,16 +13,6 @@ on: | @@ -13,16 +13,6 @@ on: | ||
| 13 | - 'sherpa-onnx/c-api/*' | 13 | - 'sherpa-onnx/c-api/*' |
| 14 | - 'c-api-examples/**' | 14 | - 'c-api-examples/**' |
| 15 | - 'ffmpeg-examples/**' | 15 | - 'ffmpeg-examples/**' |
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/c-api-from-buffer.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'sherpa-onnx/c-api/*' | ||
| 24 | - - 'c-api-examples/**' | ||
| 25 | - - 'ffmpeg-examples/**' | ||
| 26 | 16 | ||
| 27 | workflow_dispatch: | 17 | workflow_dispatch: |
| 28 | 18 |
| @@ -11,16 +11,6 @@ on: | @@ -11,16 +11,6 @@ on: | ||
| 11 | - 'sherpa-onnx/c-api/*' | 11 | - 'sherpa-onnx/c-api/*' |
| 12 | - 'c-api-examples/**' | 12 | - 'c-api-examples/**' |
| 13 | - 'ffmpeg-examples/**' | 13 | - 'ffmpeg-examples/**' |
| 14 | - pull_request: | ||
| 15 | - branches: | ||
| 16 | - - master | ||
| 17 | - paths: | ||
| 18 | - - '.github/workflows/c-api.yaml' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'sherpa-onnx/csrc/*' | ||
| 21 | - - 'sherpa-onnx/c-api/*' | ||
| 22 | - - 'c-api-examples/**' | ||
| 23 | - - 'ffmpeg-examples/**' | ||
| 24 | 14 | ||
| 25 | workflow_dispatch: | 15 | workflow_dispatch: |
| 26 | 16 |
| @@ -11,15 +11,6 @@ on: | @@ -11,15 +11,6 @@ on: | ||
| 11 | - 'sherpa-onnx/csrc/*' | 11 | - 'sherpa-onnx/csrc/*' |
| 12 | - 'sherpa-onnx/c-api/*' | 12 | - 'sherpa-onnx/c-api/*' |
| 13 | - 'cxx-api-examples/**' | 13 | - 'cxx-api-examples/**' |
| 14 | - pull_request: | ||
| 15 | - branches: | ||
| 16 | - - master | ||
| 17 | - paths: | ||
| 18 | - - '.github/workflows/cxx-api.yaml' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'sherpa-onnx/csrc/*' | ||
| 21 | - - 'sherpa-onnx/c-api/*' | ||
| 22 | - - 'cxx-api-examples/**' | ||
| 23 | 14 | ||
| 24 | workflow_dispatch: | 15 | workflow_dispatch: |
| 25 | 16 |
| @@ -10,15 +10,6 @@ on: | @@ -10,15 +10,6 @@ on: | ||
| 10 | - 'kotlin-api-examples/**' | 10 | - 'kotlin-api-examples/**' |
| 11 | - 'sherpa-onnx/csrc/*' | 11 | - 'sherpa-onnx/csrc/*' |
| 12 | - 'sherpa-onnx/jni/*' | 12 | - 'sherpa-onnx/jni/*' |
| 13 | - pull_request: | ||
| 14 | - branches: | ||
| 15 | - - master | ||
| 16 | - paths: | ||
| 17 | - - '.github/workflows/jni.yaml' | ||
| 18 | - - 'cmake/**' | ||
| 19 | - - 'kotlin-api-examples/**' | ||
| 20 | - - 'sherpa-onnx/csrc/*' | ||
| 21 | - - 'sherpa-onnx/jni/*' | ||
| 22 | 13 | ||
| 23 | workflow_dispatch: | 14 | workflow_dispatch: |
| 24 | 15 |
| @@ -13,17 +13,6 @@ on: | @@ -13,17 +13,6 @@ on: | ||
| 13 | - 'sherpa-onnx/c-api/*' | 13 | - 'sherpa-onnx/c-api/*' |
| 14 | - 'sherpa-onnx/pascal-api/*' | 14 | - 'sherpa-onnx/pascal-api/*' |
| 15 | - 'scripts/lazarus/*' | 15 | - 'scripts/lazarus/*' |
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/lazarus.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'lazarus-examples/**' | ||
| 23 | - - 'sherpa-onnx/csrc/*' | ||
| 24 | - - 'sherpa-onnx/c-api/*' | ||
| 25 | - - 'sherpa-onnx/pascal-api/*' | ||
| 26 | - - 'scripts/lazarus/*' | ||
| 27 | 16 | ||
| 28 | workflow_dispatch: | 17 | workflow_dispatch: |
| 29 | 18 |
| @@ -18,21 +18,6 @@ on: | @@ -18,21 +18,6 @@ on: | ||
| 18 | - 'sherpa-onnx/csrc/*' | 18 | - 'sherpa-onnx/csrc/*' |
| 19 | - 'sherpa-onnx/c-api/*' | 19 | - 'sherpa-onnx/c-api/*' |
| 20 | - 'c-api-examples/**' | 20 | - 'c-api-examples/**' |
| 21 | - pull_request: | ||
| 22 | - branches: | ||
| 23 | - - master | ||
| 24 | - paths: | ||
| 25 | - - '.github/workflows/linux-gpu.yaml' | ||
| 26 | - - '.github/scripts/test-online-transducer.sh' | ||
| 27 | - - '.github/scripts/test-online-paraformer.sh' | ||
| 28 | - - '.github/scripts/test-offline-transducer.sh' | ||
| 29 | - - '.github/scripts/test-offline-ctc.sh' | ||
| 30 | - - '.github/scripts/test-online-ctc.sh' | ||
| 31 | - - '.github/scripts/test-online-ctc.sh' | ||
| 32 | - - '.github/scripts/test-offline-tts.sh' | ||
| 33 | - - 'cmake/**' | ||
| 34 | - - 'sherpa-onnx/csrc/*' | ||
| 35 | - - 'sherpa-onnx/c-api/*' | ||
| 36 | 21 | ||
| 37 | workflow_dispatch: | 22 | workflow_dispatch: |
| 38 | 23 |
| @@ -12,15 +12,6 @@ on: | @@ -12,15 +12,6 @@ on: | ||
| 12 | - 'mfc-examples/**' | 12 | - 'mfc-examples/**' |
| 13 | - 'sherpa-onnx/csrc/*' | 13 | - 'sherpa-onnx/csrc/*' |
| 14 | - 'sherpa-onnx/c-api/*' | 14 | - 'sherpa-onnx/c-api/*' |
| 15 | - pull_request: | ||
| 16 | - branches: | ||
| 17 | - - master | ||
| 18 | - paths: | ||
| 19 | - - '.github/workflows/mfc.yaml' | ||
| 20 | - - 'cmake/**' | ||
| 21 | - - 'mfc-examples/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'sherpa-onnx/c-api/*' | ||
| 24 | 15 | ||
| 25 | workflow_dispatch: | 16 | workflow_dispatch: |
| 26 | 17 |
| @@ -11,16 +11,6 @@ on: | @@ -11,16 +11,6 @@ on: | ||
| 11 | - 'sherpa-onnx/csrc/*' | 11 | - 'sherpa-onnx/csrc/*' |
| 12 | - 'sherpa-onnx/c-api/*' | 12 | - 'sherpa-onnx/c-api/*' |
| 13 | - 'sherpa-onnx/pascal-api/*' | 13 | - 'sherpa-onnx/pascal-api/*' |
| 14 | - pull_request: | ||
| 15 | - branches: | ||
| 16 | - - master | ||
| 17 | - paths: | ||
| 18 | - - '.github/workflows/pascal.yaml' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'pascal-api-examples/**' | ||
| 21 | - - 'sherpa-onnx/csrc/*' | ||
| 22 | - - 'sherpa-onnx/c-api/*' | ||
| 23 | - - 'sherpa-onnx/pascal-api/*' | ||
| 24 | 14 | ||
| 25 | workflow_dispatch: | 15 | workflow_dispatch: |
| 26 | 16 |
| @@ -13,16 +13,6 @@ on: | @@ -13,16 +13,6 @@ on: | ||
| 13 | - 'build-riscv64-linux-gnu.sh' | 13 | - 'build-riscv64-linux-gnu.sh' |
| 14 | tags: | 14 | tags: |
| 15 | - 'v[0-9]+.[0-9]+.[0-9]+*' | 15 | - 'v[0-9]+.[0-9]+.[0-9]+*' |
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/riscv64-linux.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'toolchains/riscv64-linux-gnu.toolchain.cmake' | ||
| 24 | - - 'sherpa-onnx/c-api/*' | ||
| 25 | - - 'build-riscv64-linux-gnu.sh' | ||
| 26 | 16 | ||
| 27 | workflow_dispatch: | 17 | workflow_dispatch: |
| 28 | 18 |
| @@ -11,16 +11,7 @@ on: | @@ -11,16 +11,7 @@ on: | ||
| 11 | - 'sherpa-onnx/csrc/*' | 11 | - 'sherpa-onnx/csrc/*' |
| 12 | - 'sherpa-onnx/jni/*' | 12 | - 'sherpa-onnx/jni/*' |
| 13 | - 'sherpa-onnx/java-api/**' | 13 | - 'sherpa-onnx/java-api/**' |
| 14 | - pull_request: | ||
| 15 | - branches: | ||
| 16 | - - master | ||
| 17 | - paths: | ||
| 18 | - - '.github/workflows/run-java-test.yaml' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'java-api-examples/**' | ||
| 21 | - - 'sherpa-onnx/csrc/*' | ||
| 22 | - - 'sherpa-onnx/jni/*' | ||
| 23 | - - 'sherpa-onnx/java-api/**' | 14 | + |
| 24 | workflow_dispatch: | 15 | workflow_dispatch: |
| 25 | 16 | ||
| 26 | concurrency: | 17 | concurrency: |
| @@ -10,15 +10,7 @@ on: | @@ -10,15 +10,7 @@ on: | ||
| 10 | - 'cmake/**' | 10 | - 'cmake/**' |
| 11 | - 'sherpa-onnx/csrc/*' | 11 | - 'sherpa-onnx/csrc/*' |
| 12 | - 'python-api-examples/**' | 12 | - 'python-api-examples/**' |
| 13 | - pull_request: | ||
| 14 | - branches: | ||
| 15 | - - master | ||
| 16 | - paths: | ||
| 17 | - - '.github/workflows/run-python-test-macos.yaml' | ||
| 18 | - - '.github/scripts/test-python.sh' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'sherpa-onnx/csrc/*' | ||
| 21 | - - 'python-api-examples/**' | 13 | + |
| 22 | workflow_dispatch: | 14 | workflow_dispatch: |
| 23 | 15 | ||
| 24 | concurrency: | 16 | concurrency: |
| @@ -23,12 +23,7 @@ on: | @@ -23,12 +23,7 @@ on: | ||
| 23 | paths: | 23 | paths: |
| 24 | - '.github/workflows/style_check.yaml' | 24 | - '.github/workflows/style_check.yaml' |
| 25 | - 'sherpa-onnx/**' | 25 | - 'sherpa-onnx/**' |
| 26 | - pull_request: | ||
| 27 | - branches: | ||
| 28 | - - master | ||
| 29 | - paths: | ||
| 30 | - - '.github/workflows/style_check.yaml' | ||
| 31 | - - 'sherpa-onnx/**' | 26 | + |
| 32 | workflow_dispatch: | 27 | workflow_dispatch: |
| 33 | 28 | ||
| 34 | concurrency: | 29 | concurrency: |
| @@ -10,15 +10,6 @@ on: | @@ -10,15 +10,6 @@ on: | ||
| 10 | - 'cmake/**' | 10 | - 'cmake/**' |
| 11 | - 'sherpa-onnx/csrc/*' | 11 | - 'sherpa-onnx/csrc/*' |
| 12 | - 'sherpa-onnx/python/**' | 12 | - 'sherpa-onnx/python/**' |
| 13 | - pull_request: | ||
| 14 | - branches: | ||
| 15 | - - master | ||
| 16 | - paths: | ||
| 17 | - - 'setup.py' | ||
| 18 | - - '.github/workflows/test-build-wheel.yaml' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'sherpa-onnx/csrc/*' | ||
| 21 | - - 'sherpa-onnx/python/**' | ||
| 22 | 13 | ||
| 23 | workflow_dispatch: | 14 | workflow_dispatch: |
| 24 | 15 | ||
| @@ -144,7 +135,7 @@ jobs: | @@ -144,7 +135,7 @@ jobs: | ||
| 144 | export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH | 135 | export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH |
| 145 | export PATH=/c/hostedtoolcache/windows/Python/3.11.9/x64/bin:$PATH | 136 | export PATH=/c/hostedtoolcache/windows/Python/3.11.9/x64/bin:$PATH |
| 146 | export PATH=/c/hostedtoolcache/windows/Python/3.12.10/x64/bin:$PATH | 137 | export PATH=/c/hostedtoolcache/windows/Python/3.12.10/x64/bin:$PATH |
| 147 | - export PATH=/c/hostedtoolcache/windows/Python/3.13.5/x64/bin:$PATH | 138 | + export PATH=/c/hostedtoolcache/windows/Python/3.13.6/x64/bin:$PATH |
| 148 | 139 | ||
| 149 | which sherpa-onnx | 140 | which sherpa-onnx |
| 150 | sherpa-onnx --help | 141 | sherpa-onnx --help |
| @@ -10,14 +10,6 @@ on: | @@ -10,14 +10,6 @@ on: | ||
| 10 | - '.github/scripts/test-dart.sh' | 10 | - '.github/scripts/test-dart.sh' |
| 11 | - 'dart-api-examples/**' | 11 | - 'dart-api-examples/**' |
| 12 | - 'flutter/**' | 12 | - 'flutter/**' |
| 13 | - pull_request: | ||
| 14 | - branches: | ||
| 15 | - - master | ||
| 16 | - paths: | ||
| 17 | - - '.github/workflows/test-dart.yaml' | ||
| 18 | - - '.github/scripts/test-dart.sh' | ||
| 19 | - - 'dart-api-examples/**' | ||
| 20 | - - 'flutter/**' | ||
| 21 | 13 | ||
| 22 | workflow_dispatch: | 14 | workflow_dispatch: |
| 23 | 15 |
| @@ -11,16 +11,6 @@ on: | @@ -11,16 +11,6 @@ on: | ||
| 11 | - 'dotnet-examples/**' | 11 | - 'dotnet-examples/**' |
| 12 | - 'scripts/dotnet/**' | 12 | - 'scripts/dotnet/**' |
| 13 | 13 | ||
| 14 | - pull_request: | ||
| 15 | - branches: | ||
| 16 | - - master | ||
| 17 | - paths: | ||
| 18 | - - '.github/workflows/test-dot-net.yaml' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'sherpa-onnx/csrc/*' | ||
| 21 | - - 'dotnet-examples/**' | ||
| 22 | - - 'scripts/dotnet/**' | ||
| 23 | - | ||
| 24 | workflow_dispatch: | 14 | workflow_dispatch: |
| 25 | 15 | ||
| 26 | concurrency: | 16 | concurrency: |
| @@ -10,15 +10,6 @@ on: | @@ -10,15 +10,6 @@ on: | ||
| 10 | - 'sherpa-onnx/csrc/*' | 10 | - 'sherpa-onnx/csrc/*' |
| 11 | - 'go-api-examples/**' | 11 | - 'go-api-examples/**' |
| 12 | - 'scripts/go/**' | 12 | - 'scripts/go/**' |
| 13 | - pull_request: | ||
| 14 | - branches: | ||
| 15 | - - master | ||
| 16 | - paths: | ||
| 17 | - - '.github/workflows/test-go.yaml' | ||
| 18 | - - 'cmake/**' | ||
| 19 | - - 'sherpa-onnx/csrc/*' | ||
| 20 | - - 'go-api-examples/**' | ||
| 21 | - - 'scripts/go/**' | ||
| 22 | 13 | ||
| 23 | workflow_dispatch: | 14 | workflow_dispatch: |
| 24 | 15 |
| @@ -11,16 +11,6 @@ on: | @@ -11,16 +11,6 @@ on: | ||
| 11 | - 'sherpa-onnx/c-api/*' | 11 | - 'sherpa-onnx/c-api/*' |
| 12 | - 'scripts/node-addon-api/**' | 12 | - 'scripts/node-addon-api/**' |
| 13 | 13 | ||
| 14 | - pull_request: | ||
| 15 | - branches: | ||
| 16 | - - master | ||
| 17 | - paths: | ||
| 18 | - - '.github/workflows/test-nodejs-addon-api.yaml' | ||
| 19 | - - 'cmake/**' | ||
| 20 | - - 'sherpa-onnx/csrc/*' | ||
| 21 | - - 'sherpa-onnx/c-api/*' | ||
| 22 | - - 'scripts/node-addon-api/**' | ||
| 23 | - | ||
| 24 | workflow_dispatch: | 14 | workflow_dispatch: |
| 25 | 15 | ||
| 26 | concurrency: | 16 | concurrency: |
| @@ -13,17 +13,6 @@ on: | @@ -13,17 +13,6 @@ on: | ||
| 13 | - 'scripts/node-addon-api/*.js' | 13 | - 'scripts/node-addon-api/*.js' |
| 14 | - 'nodejs-addon-examples/package.json' | 14 | - 'nodejs-addon-examples/package.json' |
| 15 | 15 | ||
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/test-nodejs-addon-npm-aarch64.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'sherpa-onnx/c-api/*' | ||
| 24 | - - 'scripts/node-addon-api/*.js' | ||
| 25 | - - 'nodejs-addon-examples/package.json' | ||
| 26 | - | ||
| 27 | workflow_dispatch: | 16 | workflow_dispatch: |
| 28 | 17 | ||
| 29 | concurrency: | 18 | concurrency: |
| @@ -14,18 +14,6 @@ on: | @@ -14,18 +14,6 @@ on: | ||
| 14 | - 'nodejs-addon-examples/package.json' | 14 | - 'nodejs-addon-examples/package.json' |
| 15 | - '.github/scripts/test-nodejs-addon-npm.sh' | 15 | - '.github/scripts/test-nodejs-addon-npm.sh' |
| 16 | 16 | ||
| 17 | - pull_request: | ||
| 18 | - branches: | ||
| 19 | - - master | ||
| 20 | - paths: | ||
| 21 | - - '.github/workflows/test-nodejs-addon-npm-win-x86.yaml' | ||
| 22 | - - 'cmake/**' | ||
| 23 | - - 'sherpa-onnx/csrc/*' | ||
| 24 | - - 'sherpa-onnx/c-api/*' | ||
| 25 | - - 'scripts/node-addon-api/*.js' | ||
| 26 | - - 'nodejs-addon-examples/package.json' | ||
| 27 | - - '.github/scripts/test-nodejs-addon-npm.sh' | ||
| 28 | - | ||
| 29 | workflow_dispatch: | 17 | workflow_dispatch: |
| 30 | 18 | ||
| 31 | concurrency: | 19 | concurrency: |
| @@ -13,17 +13,6 @@ on: | @@ -13,17 +13,6 @@ on: | ||
| 13 | - 'scripts/node-addon-api/*.js' | 13 | - 'scripts/node-addon-api/*.js' |
| 14 | - 'nodejs-addon-examples/package.json' | 14 | - 'nodejs-addon-examples/package.json' |
| 15 | 15 | ||
| 16 | - pull_request: | ||
| 17 | - branches: | ||
| 18 | - - master | ||
| 19 | - paths: | ||
| 20 | - - '.github/workflows/test-nodejs-addon-npm.yaml' | ||
| 21 | - - 'cmake/**' | ||
| 22 | - - 'sherpa-onnx/csrc/*' | ||
| 23 | - - 'sherpa-onnx/c-api/*' | ||
| 24 | - - 'scripts/node-addon-api/*.js' | ||
| 25 | - - 'nodejs-addon-examples/package.json' | ||
| 26 | - | ||
| 27 | workflow_dispatch: | 16 | workflow_dispatch: |
| 28 | 17 | ||
| 29 | concurrency: | 18 | concurrency: |
| @@ -12,17 +12,6 @@ on: | @@ -12,17 +12,6 @@ on: | ||
| 12 | - 'scripts/nodejs/**' | 12 | - 'scripts/nodejs/**' |
| 13 | - 'nodejs-examples/**' | 13 | - 'nodejs-examples/**' |
| 14 | 14 | ||
| 15 | - pull_request: | ||
| 16 | - branches: | ||
| 17 | - - master | ||
| 18 | - paths: | ||
| 19 | - - '.github/workflows/test-nodejs.yaml' | ||
| 20 | - - 'cmake/**' | ||
| 21 | - - 'sherpa-onnx/csrc/*' | ||
| 22 | - - 'sherpa-onnx/c-api/*' | ||
| 23 | - - 'scripts/nodejs/**' | ||
| 24 | - - 'nodejs-examples/**' | ||
| 25 | - | ||
| 26 | workflow_dispatch: | 15 | workflow_dispatch: |
| 27 | 16 | ||
| 28 | concurrency: | 17 | concurrency: |
| @@ -117,7 +117,7 @@ jobs: | @@ -117,7 +117,7 @@ jobs: | ||
| 117 | export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH | 117 | export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH |
| 118 | export PATH=/c/hostedtoolcache/windows/Python/3.11.9/x64/bin:$PATH | 118 | export PATH=/c/hostedtoolcache/windows/Python/3.11.9/x64/bin:$PATH |
| 119 | export PATH=/c/hostedtoolcache/windows/Python/3.12.10/x64/bin:$PATH | 119 | export PATH=/c/hostedtoolcache/windows/Python/3.12.10/x64/bin:$PATH |
| 120 | - export PATH=/c/hostedtoolcache/windows/Python/3.13.5/x64/bin:$PATH | 120 | + export PATH=/c/hostedtoolcache/windows/Python/3.13.6/x64/bin:$PATH |
| 121 | 121 | ||
| 122 | sherpa-onnx --help | 122 | sherpa-onnx --help |
| 123 | sherpa-onnx-keyword-spotter --help | 123 | sherpa-onnx-keyword-spotter --help |
| @@ -7,13 +7,6 @@ on: | @@ -7,13 +7,6 @@ on: | ||
| 7 | - '.github/workflows/test-piper-phonemize.yaml' | 7 | - '.github/workflows/test-piper-phonemize.yaml' |
| 8 | - 'cmake/**' | 8 | - 'cmake/**' |
| 9 | - 'sherpa-onnx/csrc/*' | 9 | - 'sherpa-onnx/csrc/*' |
| 10 | - pull_request: | ||
| 11 | - branches: | ||
| 12 | - - master | ||
| 13 | - paths: | ||
| 14 | - - '.github/workflows/test-piper-phonemize.yaml' | ||
| 15 | - - 'cmake/**' | ||
| 16 | - - 'sherpa-onnx/csrc/*' | ||
| 17 | 10 | ||
| 18 | workflow_dispatch: | 11 | workflow_dispatch: |
| 19 | 12 |
| @@ -9,14 +9,7 @@ on: | @@ -9,14 +9,7 @@ on: | ||
| 9 | - 'cmake/**' | 9 | - 'cmake/**' |
| 10 | - 'sherpa-onnx/csrc/*' | 10 | - 'sherpa-onnx/csrc/*' |
| 11 | - 'sherpa-onnx/python/**' | 11 | - 'sherpa-onnx/python/**' |
| 12 | - pull_request: | ||
| 13 | - branches: | ||
| 14 | - - master | ||
| 15 | - paths: | ||
| 16 | - - '.github/workflows/test-python-offline-websocket-server.yaml' | ||
| 17 | - - 'cmake/**' | ||
| 18 | - - 'sherpa-onnx/csrc/*' | ||
| 19 | - - 'sherpa-onnx/python/**' | 12 | + |
| 20 | workflow_dispatch: | 13 | workflow_dispatch: |
| 21 | 14 | ||
| 22 | concurrency: | 15 | concurrency: |
| @@ -9,14 +9,7 @@ on: | @@ -9,14 +9,7 @@ on: | ||
| 9 | - 'cmake/**' | 9 | - 'cmake/**' |
| 10 | - 'sherpa-onnx/csrc/*' | 10 | - 'sherpa-onnx/csrc/*' |
| 11 | - 'sherpa-onnx/python/**' | 11 | - 'sherpa-onnx/python/**' |
| 12 | - pull_request: | ||
| 13 | - branches: | ||
| 14 | - - master | ||
| 15 | - paths: | ||
| 16 | - - '.github/workflows/test-python-online-websocket-server.yaml' | ||
| 17 | - - 'cmake/**' | ||
| 18 | - - 'sherpa-onnx/csrc/*' | ||
| 19 | - - 'sherpa-onnx/python/**' | 12 | + |
| 20 | workflow_dispatch: | 13 | workflow_dispatch: |
| 21 | 14 | ||
| 22 | concurrency: | 15 | concurrency: |
| @@ -10,13 +10,6 @@ on: | @@ -10,13 +10,6 @@ on: | ||
| 10 | - '.github/workflows/windows-arm64.yaml' | 10 | - '.github/workflows/windows-arm64.yaml' |
| 11 | - 'cmake/**' | 11 | - 'cmake/**' |
| 12 | - 'sherpa-onnx/csrc/*' | 12 | - 'sherpa-onnx/csrc/*' |
| 13 | - pull_request: | ||
| 14 | - branches: | ||
| 15 | - - master | ||
| 16 | - paths: | ||
| 17 | - - '.github/workflows/windows-arm64.yaml' | ||
| 18 | - - 'cmake/**' | ||
| 19 | - - 'sherpa-onnx/csrc/*' | ||
| 20 | 13 | ||
| 21 | workflow_dispatch: | 14 | workflow_dispatch: |
| 22 | 15 |
| @@ -16,19 +16,6 @@ on: | @@ -16,19 +16,6 @@ on: | ||
| 16 | - '.github/scripts/test-offline-tts.sh' | 16 | - '.github/scripts/test-offline-tts.sh' |
| 17 | - 'cmake/**' | 17 | - 'cmake/**' |
| 18 | - 'sherpa-onnx/csrc/*' | 18 | - 'sherpa-onnx/csrc/*' |
| 19 | - pull_request: | ||
| 20 | - branches: | ||
| 21 | - - master | ||
| 22 | - paths: | ||
| 23 | - - '.github/workflows/windows-x64-cuda.yaml' | ||
| 24 | - - '.github/scripts/test-online-transducer.sh' | ||
| 25 | - - '.github/scripts/test-online-paraformer.sh' | ||
| 26 | - - '.github/scripts/test-offline-transducer.sh' | ||
| 27 | - - '.github/scripts/test-offline-ctc.sh' | ||
| 28 | - - '.github/scripts/test-online-ctc.sh' | ||
| 29 | - - '.github/scripts/test-offline-tts.sh' | ||
| 30 | - - 'cmake/**' | ||
| 31 | - - 'sherpa-onnx/csrc/*' | ||
| 32 | 19 | ||
| 33 | workflow_dispatch: | 20 | workflow_dispatch: |
| 34 | 21 |
| @@ -16,19 +16,6 @@ on: | @@ -16,19 +16,6 @@ on: | ||
| 16 | - '.github/scripts/test-offline-tts.sh' | 16 | - '.github/scripts/test-offline-tts.sh' |
| 17 | - 'cmake/**' | 17 | - 'cmake/**' |
| 18 | - 'sherpa-onnx/csrc/*' | 18 | - 'sherpa-onnx/csrc/*' |
| 19 | - pull_request: | ||
| 20 | - branches: | ||
| 21 | - - master | ||
| 22 | - paths: | ||
| 23 | - - '.github/workflows/windows-x64-debug.yaml' | ||
| 24 | - - '.github/scripts/test-online-transducer.sh' | ||
| 25 | - - '.github/scripts/test-online-paraformer.sh' | ||
| 26 | - - '.github/scripts/test-offline-transducer.sh' | ||
| 27 | - - '.github/scripts/test-offline-ctc.sh' | ||
| 28 | - - '.github/scripts/test-online-ctc.sh' | ||
| 29 | - - '.github/scripts/test-offline-tts.sh' | ||
| 30 | - - 'cmake/**' | ||
| 31 | - - 'sherpa-onnx/csrc/*' | ||
| 32 | 19 | ||
| 33 | workflow_dispatch: | 20 | workflow_dispatch: |
| 34 | 21 |
| @@ -22,25 +22,6 @@ on: | @@ -22,25 +22,6 @@ on: | ||
| 22 | - '.github/scripts/test-cxx-api.sh' | 22 | - '.github/scripts/test-cxx-api.sh' |
| 23 | - 'cmake/**' | 23 | - 'cmake/**' |
| 24 | - 'sherpa-onnx/csrc/*' | 24 | - 'sherpa-onnx/csrc/*' |
| 25 | - pull_request: | ||
| 26 | - branches: | ||
| 27 | - - master | ||
| 28 | - paths: | ||
| 29 | - - '.github/workflows/windows-x64.yaml' | ||
| 30 | - - '.github/scripts/test-online-transducer.sh' | ||
| 31 | - - '.github/scripts/test-online-paraformer.sh' | ||
| 32 | - - '.github/scripts/test-offline-transducer.sh' | ||
| 33 | - - '.github/scripts/test-offline-ctc.sh' | ||
| 34 | - - '.github/scripts/test-online-ctc.sh' | ||
| 35 | - - '.github/scripts/test-offline-tts.sh' | ||
| 36 | - - '.github/scripts/test-audio-tagging.sh' | ||
| 37 | - - '.github/scripts/test-offline-punctuation.sh' | ||
| 38 | - - '.github/scripts/test-online-punctuation.sh' | ||
| 39 | - - '.github/scripts/test-speaker-diarization.sh' | ||
| 40 | - - '.github/scripts/test-c-api.sh' | ||
| 41 | - - '.github/scripts/test-cxx-api.sh' | ||
| 42 | - - 'cmake/**' | ||
| 43 | - - 'sherpa-onnx/csrc/*' | ||
| 44 | 25 | ||
| 45 | workflow_dispatch: | 26 | workflow_dispatch: |
| 46 | 27 |
| @@ -16,19 +16,6 @@ on: | @@ -16,19 +16,6 @@ on: | ||
| 16 | - '.github/scripts/test-online-ctc.sh' | 16 | - '.github/scripts/test-online-ctc.sh' |
| 17 | - 'cmake/**' | 17 | - 'cmake/**' |
| 18 | - 'sherpa-onnx/csrc/*' | 18 | - 'sherpa-onnx/csrc/*' |
| 19 | - pull_request: | ||
| 20 | - branches: | ||
| 21 | - - master | ||
| 22 | - paths: | ||
| 23 | - - '.github/workflows/windows-x86-debug.yaml' | ||
| 24 | - - '.github/scripts/test-online-transducer.sh' | ||
| 25 | - - '.github/scripts/test-online-paraformer.sh' | ||
| 26 | - - '.github/scripts/test-offline-transducer.sh' | ||
| 27 | - - '.github/scripts/test-offline-ctc.sh' | ||
| 28 | - - '.github/scripts/test-offline-tts.sh' | ||
| 29 | - - '.github/scripts/test-online-ctc.sh' | ||
| 30 | - - 'cmake/**' | ||
| 31 | - - 'sherpa-onnx/csrc/*' | ||
| 32 | 19 | ||
| 33 | workflow_dispatch: | 20 | workflow_dispatch: |
| 34 | 21 |
| @@ -22,25 +22,6 @@ on: | @@ -22,25 +22,6 @@ on: | ||
| 22 | - '.github/scripts/test-cxx-api.sh' | 22 | - '.github/scripts/test-cxx-api.sh' |
| 23 | - 'cmake/**' | 23 | - 'cmake/**' |
| 24 | - 'sherpa-onnx/csrc/*' | 24 | - 'sherpa-onnx/csrc/*' |
| 25 | - pull_request: | ||
| 26 | - branches: | ||
| 27 | - - master | ||
| 28 | - paths: | ||
| 29 | - - '.github/workflows/windows-x86.yaml' | ||
| 30 | - - '.github/scripts/test-online-transducer.sh' | ||
| 31 | - - '.github/scripts/test-online-paraformer.sh' | ||
| 32 | - - '.github/scripts/test-offline-transducer.sh' | ||
| 33 | - - '.github/scripts/test-offline-ctc.sh' | ||
| 34 | - - '.github/scripts/test-offline-tts.sh' | ||
| 35 | - - '.github/scripts/test-online-ctc.sh' | ||
| 36 | - - '.github/scripts/test-audio-tagging.sh' | ||
| 37 | - - '.github/scripts/test-offline-punctuation.sh' | ||
| 38 | - - '.github/scripts/test-online-punctuation.sh' | ||
| 39 | - - '.github/scripts/test-speaker-diarization.sh' | ||
| 40 | - - '.github/scripts/test-c-api.sh' | ||
| 41 | - - '.github/scripts/test-cxx-api.sh' | ||
| 42 | - - 'cmake/**' | ||
| 43 | - - 'sherpa-onnx/csrc/*' | ||
| 44 | 25 | ||
| 45 | workflow_dispatch: | 26 | workflow_dispatch: |
| 46 | 27 |
| @@ -8,17 +8,23 @@ https://github.com/k2-fsa/sherpa-onnx/releases/tag/speaker-recongition-models | @@ -8,17 +8,23 @@ https://github.com/k2-fsa/sherpa-onnx/releases/tag/speaker-recongition-models | ||
| 8 | func cosineSimilarity(_ a: [Float], _ b: [Float]) -> Float { | 8 | func cosineSimilarity(_ a: [Float], _ b: [Float]) -> Float { |
| 9 | precondition(a.count == b.count, "Vectors must have the same length") | 9 | precondition(a.count == b.count, "Vectors must have the same length") |
| 10 | 10 | ||
| 11 | - // Dot product | ||
| 12 | - let dotProduct = zip(a, b).reduce(0) { $0 + $1.0 * $1.1 } | 11 | + var dot: Float = 0 |
| 12 | + var sumA: Float = 0 | ||
| 13 | + var sumB: Float = 0 | ||
| 14 | + | ||
| 15 | + for i in 0..<a.count { | ||
| 16 | + let x = a[i] | ||
| 17 | + let y = b[i] | ||
| 18 | + dot += x * y | ||
| 19 | + sumA += x * x | ||
| 20 | + sumB += y * y | ||
| 21 | + } | ||
| 13 | 22 | ||
| 14 | - // Magnitudes | ||
| 15 | - let magA = sqrt(a.reduce(0) { $0 + $1 * $1 }) | ||
| 16 | - let magB = sqrt(b.reduce(0) { $0 + $1 * $1 }) | 23 | + let magA = sqrt(sumA) |
| 24 | + let magB = sqrt(sumB) | ||
| 17 | 25 | ||
| 18 | - // Avoid division by zero | ||
| 19 | guard magA > 0 && magB > 0 else { return 0 } | 26 | guard magA > 0 && magB > 0 else { return 0 } |
| 20 | - | ||
| 21 | - return dotProduct / (magA * magB) | 27 | + return dot / (magA * magB) |
| 22 | } | 28 | } |
| 23 | 29 | ||
| 24 | func computeEmbedding(extractor: SherpaOnnxSpeakerEmbeddingExtractorWrapper, waveFilename: String) | 30 | func computeEmbedding(extractor: SherpaOnnxSpeakerEmbeddingExtractorWrapper, waveFilename: String) |
-
请 注册 或 登录 后发表评论