Merge branch 'master' of https://github.com/k2-fsa/sherpa-onnx
正在显示
50 个修改的文件
包含
3208 行增加
和
546 行删除
| @@ -4,6 +4,40 @@ set -ex | @@ -4,6 +4,40 @@ set -ex | ||
| 4 | 4 | ||
| 5 | cd dart-api-examples | 5 | cd dart-api-examples |
| 6 | 6 | ||
| 7 | +pushd spoken-language-identification | ||
| 8 | +./run-whisper.sh | ||
| 9 | +popd | ||
| 10 | + | ||
| 11 | +pushd streaming-asr | ||
| 12 | + | ||
| 13 | +echo '----------streaming T-one ctc----------' | ||
| 14 | +./run-t-one-ctc.sh | ||
| 15 | +rm -rf sherpa-onnx-* | ||
| 16 | + | ||
| 17 | +echo '----------streaming zipformer ctc HLG----------' | ||
| 18 | +./run-zipformer-ctc-hlg.sh | ||
| 19 | +rm -rf sherpa-onnx-* | ||
| 20 | + | ||
| 21 | +echo '----------streaming zipformer ctc----------' | ||
| 22 | +./run-zipformer-ctc.sh | ||
| 23 | +rm -rf sherpa-onnx-* | ||
| 24 | + | ||
| 25 | +echo '----------streaming zipformer transducer----------' | ||
| 26 | +./run-zipformer-transducer-itn.sh | ||
| 27 | +./run-zipformer-transducer.sh | ||
| 28 | +rm -f itn* | ||
| 29 | +rm -rf sherpa-onnx-* | ||
| 30 | + | ||
| 31 | +echo '----------streaming NeMo transducer----------' | ||
| 32 | +./run-nemo-transducer.sh | ||
| 33 | +rm -rf sherpa-onnx-* | ||
| 34 | + | ||
| 35 | +echo '----------streaming paraformer----------' | ||
| 36 | +./run-paraformer.sh | ||
| 37 | +rm -rf sherpa-onnx-* | ||
| 38 | + | ||
| 39 | +popd # streaming-asr | ||
| 40 | + | ||
| 7 | pushd tts | 41 | pushd tts |
| 8 | 42 | ||
| 9 | echo '----------matcha tts----------' | 43 | echo '----------matcha tts----------' |
| @@ -40,6 +74,10 @@ popd | @@ -40,6 +74,10 @@ popd | ||
| 40 | 74 | ||
| 41 | pushd non-streaming-asr | 75 | pushd non-streaming-asr |
| 42 | 76 | ||
| 77 | +echo '----------Wenet CTC----------' | ||
| 78 | +./run-wenet-ctc.sh | ||
| 79 | +rm -rf sherpa-onnx-* | ||
| 80 | + | ||
| 43 | echo '----------Zipformer CTC----------' | 81 | echo '----------Zipformer CTC----------' |
| 44 | ./run-zipformer-ctc.sh | 82 | ./run-zipformer-ctc.sh |
| 45 | rm -rf sherpa-onnx-* | 83 | rm -rf sherpa-onnx-* |
| @@ -167,29 +205,3 @@ popd | @@ -167,29 +205,3 @@ popd | ||
| 167 | pushd keyword-spotter | 205 | pushd keyword-spotter |
| 168 | ./run-zh.sh | 206 | ./run-zh.sh |
| 169 | popd | 207 | popd |
| 170 | - | ||
| 171 | -pushd streaming-asr | ||
| 172 | - | ||
| 173 | -echo '----------streaming zipformer ctc HLG----------' | ||
| 174 | -./run-zipformer-ctc-hlg.sh | ||
| 175 | -rm -rf sherpa-onnx-* | ||
| 176 | - | ||
| 177 | -echo '----------streaming zipformer ctc----------' | ||
| 178 | -./run-zipformer-ctc.sh | ||
| 179 | -rm -rf sherpa-onnx-* | ||
| 180 | - | ||
| 181 | -echo '----------streaming zipformer transducer----------' | ||
| 182 | -./run-zipformer-transducer-itn.sh | ||
| 183 | -./run-zipformer-transducer.sh | ||
| 184 | -rm -f itn* | ||
| 185 | -rm -rf sherpa-onnx-* | ||
| 186 | - | ||
| 187 | -echo '----------streaming NeMo transducer----------' | ||
| 188 | -./run-nemo-transducer.sh | ||
| 189 | -rm -rf sherpa-onnx-* | ||
| 190 | - | ||
| 191 | -echo '----------streaming paraformer----------' | ||
| 192 | -./run-paraformer.sh | ||
| 193 | -rm -rf sherpa-onnx-* | ||
| 194 | - | ||
| 195 | -popd # streaming-asr |
| @@ -27,6 +27,9 @@ rm -rf sherpa-onnx-nemo-* | @@ -27,6 +27,9 @@ rm -rf sherpa-onnx-nemo-* | ||
| 27 | 27 | ||
| 28 | cd ../offline-decode-files | 28 | cd ../offline-decode-files |
| 29 | 29 | ||
| 30 | +./run-wenet-ctc.sh | ||
| 31 | +rm -rf sherpa-onnx-* | ||
| 32 | + | ||
| 30 | ./run-zipformer-ctc.sh | 33 | ./run-zipformer-ctc.sh |
| 31 | rm -rf sherpa-onnx-* | 34 | rm -rf sherpa-onnx-* |
| 32 | 35 | ||
| @@ -108,6 +111,9 @@ cd ../keyword-spotting-from-files | @@ -108,6 +111,9 @@ cd ../keyword-spotting-from-files | ||
| 108 | ./run.sh | 111 | ./run.sh |
| 109 | 112 | ||
| 110 | cd ../online-decode-files | 113 | cd ../online-decode-files |
| 114 | +./run-t-one-ctc.sh | ||
| 115 | +rm -rf sherpa-onnx-* | ||
| 116 | + | ||
| 111 | ./run-transducer-itn.sh | 117 | ./run-transducer-itn.sh |
| 112 | rm -rf sherpa-onnx-* | 118 | rm -rf sherpa-onnx-* |
| 113 | 119 |
| @@ -10,6 +10,26 @@ arch=$(node -p "require('os').arch()") | @@ -10,6 +10,26 @@ arch=$(node -p "require('os').arch()") | ||
| 10 | platform=$(node -p "require('os').platform()") | 10 | platform=$(node -p "require('os').platform()") |
| 11 | node_version=$(node -p "process.versions.node.split('.')[0]") | 11 | node_version=$(node -p "process.versions.node.split('.')[0]") |
| 12 | 12 | ||
| 13 | +echo "----------non-streaming ASR Wenet CTC----------" | ||
| 14 | + | ||
| 15 | +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 16 | +tar xvf sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 17 | +rm sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 18 | + | ||
| 19 | +node ./test_asr_non_streaming_wenet_ctc.js | ||
| 20 | +rm -rf sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10 | ||
| 21 | + | ||
| 22 | +echo "----------streaming ASR T-one CTC----------" | ||
| 23 | +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 24 | +tar xvf sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 25 | +rm sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 26 | + | ||
| 27 | +node ./test_asr_streaming_t_one_ctc.js | ||
| 28 | + | ||
| 29 | +rm -rf sherpa-onnx-streaming-t-one-russian-2025-09-08 | ||
| 30 | + | ||
| 31 | +echo "----------KittenTTS----------" | ||
| 32 | + | ||
| 13 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2 | 33 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2 |
| 14 | tar xf kitten-nano-en-v0_1-fp16.tar.bz2 | 34 | tar xf kitten-nano-en-v0_1-fp16.tar.bz2 |
| 15 | rm kitten-nano-en-v0_1-fp16.tar.bz2 | 35 | rm kitten-nano-en-v0_1-fp16.tar.bz2 |
| @@ -9,6 +9,20 @@ git status | @@ -9,6 +9,20 @@ git status | ||
| 9 | ls -lh | 9 | ls -lh |
| 10 | ls -lh node_modules | 10 | ls -lh node_modules |
| 11 | 11 | ||
| 12 | +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 13 | +tar xvf sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 14 | +rm sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 15 | + | ||
| 16 | +node ./test-offline-wenet-ctc.js | ||
| 17 | +rm -rf sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10 | ||
| 18 | + | ||
| 19 | +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 20 | +tar xvf sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 21 | +rm sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 22 | +node ./test-online-t-one-ctc.js | ||
| 23 | + | ||
| 24 | +rm -rf sherpa-onnx-streaming-t-one-russian-2025-09-08 | ||
| 25 | + | ||
| 12 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2 | 26 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2 |
| 13 | tar xf kitten-nano-en-v0_1-fp16.tar.bz2 | 27 | tar xf kitten-nano-en-v0_1-fp16.tar.bz2 |
| 14 | rm kitten-nano-en-v0_1-fp16.tar.bz2 | 28 | rm kitten-nano-en-v0_1-fp16.tar.bz2 |
| @@ -8,6 +8,16 @@ log() { | @@ -8,6 +8,16 @@ log() { | ||
| 8 | echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*" | 8 | echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*" |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | +log "test T-one" | ||
| 12 | + | ||
| 13 | +curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 14 | +tar xvf sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 15 | +rm sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 16 | + | ||
| 17 | +python3 ./python-api-examples/online-t-one-ctc-decode-files.py | ||
| 18 | + | ||
| 19 | +rm -rf sherpa-onnx-streaming-t-one-russian-2025-09-08 | ||
| 20 | + | ||
| 11 | log "test nemo canary" | 21 | log "test nemo canary" |
| 12 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8.tar.bz2 | 22 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8.tar.bz2 |
| 13 | tar xvf sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8.tar.bz2 | 23 | tar xvf sherpa-onnx-nemo-canary-180m-flash-en-es-de-fr-int8.tar.bz2 |
| @@ -9,10 +9,19 @@ ls -lh | @@ -9,10 +9,19 @@ ls -lh | ||
| 9 | 9 | ||
| 10 | ./run-test-version.sh | 10 | ./run-test-version.sh |
| 11 | 11 | ||
| 12 | +./run-decode-file-t-one-streaming.sh | ||
| 13 | +rm -rf sherpa-onnx-streaming-* | ||
| 14 | + | ||
| 15 | +./run-compute-speaker-embeddings.sh | ||
| 16 | +rm -fv *.wav *.onnx | ||
| 17 | + | ||
| 12 | ./run-tts-kitten-en.sh | 18 | ./run-tts-kitten-en.sh |
| 13 | ls -lh | 19 | ls -lh |
| 14 | rm -rf kitten-* | 20 | rm -rf kitten-* |
| 15 | 21 | ||
| 22 | +./run-wenet-ctc-asr.sh | ||
| 23 | +rm -rf sherpa-onnx-* | ||
| 24 | + | ||
| 16 | ./run-zipformer-ctc-asr.sh | 25 | ./run-zipformer-ctc-asr.sh |
| 17 | rm -rf sherpa-onnx-zipformer-* | 26 | rm -rf sherpa-onnx-zipformer-* |
| 18 | 27 |
| @@ -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 | ||
| @@ -148,7 +139,7 @@ jobs: | @@ -148,7 +139,7 @@ jobs: | ||
| 148 | file: sherpa-onnx-*-android-rknn.tar.bz2 | 139 | file: sherpa-onnx-*-android-rknn.tar.bz2 |
| 149 | # repo_name: k2-fsa/sherpa-onnx | 140 | # repo_name: k2-fsa/sherpa-onnx |
| 150 | # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | 141 | # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} |
| 151 | - # tag: v1.11.3 | 142 | + # tag: v1.12.13 |
| 152 | 143 | ||
| 153 | build-android-aar-rknn: | 144 | build-android-aar-rknn: |
| 154 | needs: [build-android-rknn-libs] | 145 | needs: [build-android-rknn-libs] |
| @@ -284,7 +275,7 @@ jobs: | @@ -284,7 +275,7 @@ jobs: | ||
| 284 | file: ./*.aar | 275 | file: ./*.aar |
| 285 | # repo_name: k2-fsa/sherpa-onnx | 276 | # repo_name: k2-fsa/sherpa-onnx |
| 286 | # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | 277 | # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} |
| 287 | - # tag: v1.11.3 | 278 | + # tag: v1.12.13 |
| 288 | 279 | ||
| 289 | - name: Release android aar | 280 | - name: Release android aar |
| 290 | if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | 281 | if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| @@ -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 | ||
| @@ -68,6 +59,9 @@ jobs: | @@ -68,6 +59,9 @@ jobs: | ||
| 68 | export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME | 59 | export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME |
| 69 | export SHERPA_ONNX_ENABLE_C_API=ON | 60 | export SHERPA_ONNX_ENABLE_C_API=ON |
| 70 | ./build-android-arm64-v8a.sh | 61 | ./build-android-arm64-v8a.sh |
| 62 | + | ||
| 63 | + readelf -l ./build-android-arm64-v8a/install/lib/*.so | ||
| 64 | + | ||
| 71 | mkdir -p jniLibs/arm64-v8a/ | 65 | mkdir -p jniLibs/arm64-v8a/ |
| 72 | cp -v ./build-android-arm64-v8a/install/lib/*.so ./jniLibs/arm64-v8a/ | 66 | cp -v ./build-android-arm64-v8a/install/lib/*.so ./jniLibs/arm64-v8a/ |
| 73 | cp -v ./build-android-arm64-v8a/install/lib/README.md ./jniLibs/arm64-v8a/ | 67 | cp -v ./build-android-arm64-v8a/install/lib/README.md ./jniLibs/arm64-v8a/ |
| @@ -83,6 +77,9 @@ jobs: | @@ -83,6 +77,9 @@ jobs: | ||
| 83 | export SHERPA_ONNX_ENABLE_C_API=ON | 77 | export SHERPA_ONNX_ENABLE_C_API=ON |
| 84 | ./build-android-armv7-eabi.sh | 78 | ./build-android-armv7-eabi.sh |
| 85 | mkdir -p ./jniLibs/armeabi-v7a/ | 79 | mkdir -p ./jniLibs/armeabi-v7a/ |
| 80 | + | ||
| 81 | + readelf -l ./build-android-armv7-eabi/install/lib/*.so | ||
| 82 | + | ||
| 86 | cp -v ./build-android-armv7-eabi/install/lib/*.so ./jniLibs/armeabi-v7a/ | 83 | cp -v ./build-android-armv7-eabi/install/lib/*.so ./jniLibs/armeabi-v7a/ |
| 87 | cp -v ./build-android-armv7-eabi/install/lib/README.md ./jniLibs/armeabi-v7a/ | 84 | cp -v ./build-android-armv7-eabi/install/lib/README.md ./jniLibs/armeabi-v7a/ |
| 88 | rm -rf ./build-android-armv7-eabi | 85 | rm -rf ./build-android-armv7-eabi |
| @@ -96,6 +93,9 @@ jobs: | @@ -96,6 +93,9 @@ jobs: | ||
| 96 | export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME | 93 | export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME |
| 97 | export SHERPA_ONNX_ENABLE_C_API=ON | 94 | export SHERPA_ONNX_ENABLE_C_API=ON |
| 98 | ./build-android-x86-64.sh | 95 | ./build-android-x86-64.sh |
| 96 | + | ||
| 97 | + readelf -l ./build-android-x86-64/install/lib/*.so | ||
| 98 | + | ||
| 99 | mkdir -p ./jniLibs/x86_64 | 99 | mkdir -p ./jniLibs/x86_64 |
| 100 | cp -v ./build-android-x86-64/install/lib/*.so ./jniLibs/x86_64 | 100 | cp -v ./build-android-x86-64/install/lib/*.so ./jniLibs/x86_64 |
| 101 | cp -v ./build-android-x86-64/install/lib/README.md ./jniLibs/x86_64 | 101 | cp -v ./build-android-x86-64/install/lib/README.md ./jniLibs/x86_64 |
| @@ -110,6 +110,9 @@ jobs: | @@ -110,6 +110,9 @@ jobs: | ||
| 110 | export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME | 110 | export ANDROID_NDK=$ANDROID_NDK_LATEST_HOME |
| 111 | export SHERPA_ONNX_ENABLE_C_API=ON | 111 | export SHERPA_ONNX_ENABLE_C_API=ON |
| 112 | ./build-android-x86.sh | 112 | ./build-android-x86.sh |
| 113 | + | ||
| 114 | + readelf -l ./build-android-x86/install/lib/*.so | ||
| 115 | + | ||
| 113 | mkdir -p ./jniLibs/x86 | 116 | mkdir -p ./jniLibs/x86 |
| 114 | cp -v ./build-android-x86/install/lib/*.so ./jniLibs/x86 | 117 | cp -v ./build-android-x86/install/lib/*.so ./jniLibs/x86 |
| 115 | cp -v ./build-android-x86/install/lib/README.md ./jniLibs/x86 | 118 | cp -v ./build-android-x86/install/lib/README.md ./jniLibs/x86 |
| @@ -174,7 +177,7 @@ jobs: | @@ -174,7 +177,7 @@ jobs: | ||
| 174 | file: sherpa-onnx-*-android.tar.bz2 | 177 | file: sherpa-onnx-*-android.tar.bz2 |
| 175 | # repo_name: k2-fsa/sherpa-onnx | 178 | # repo_name: k2-fsa/sherpa-onnx |
| 176 | # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | 179 | # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} |
| 177 | - # tag: v1.11.5 | 180 | + # tag: v1.12.11 |
| 178 | 181 | ||
| 179 | build-android-aar: | 182 | build-android-aar: |
| 180 | needs: [build-android-libs] | 183 | needs: [build-android-libs] |
| @@ -307,9 +310,9 @@ jobs: | @@ -307,9 +310,9 @@ jobs: | ||
| 307 | file_glob: true | 310 | file_glob: true |
| 308 | overwrite: true | 311 | overwrite: true |
| 309 | file: ./*.aar | 312 | file: ./*.aar |
| 310 | - # repo_name: k2-fsa/sherpa-onnx | ||
| 311 | - # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 312 | - # tag: v1.11.5 | 313 | + repo_name: k2-fsa/sherpa-onnx |
| 314 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 315 | + tag: v1.12.11 | ||
| 313 | 316 | ||
| 314 | - name: Release android aar | 317 | - name: Release android aar |
| 315 | if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | 318 | if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| @@ -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 |
| @@ -5,6 +5,12 @@ on: | @@ -5,6 +5,12 @@ on: | ||
| 5 | branches: | 5 | branches: |
| 6 | - wheel | 6 | - wheel |
| 7 | workflow_dispatch: | 7 | workflow_dispatch: |
| 8 | + inputs: | ||
| 9 | + publish_sherpa_onnx_bin: | ||
| 10 | + description: "Publish sherpa-onnx-bin" | ||
| 11 | + required: false | ||
| 12 | + default: "true" | ||
| 13 | + type: boolean | ||
| 8 | 14 | ||
| 9 | env: | 15 | env: |
| 10 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 | 16 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 |
| @@ -14,7 +20,277 @@ concurrency: | @@ -14,7 +20,277 @@ concurrency: | ||
| 14 | cancel-in-progress: true | 20 | cancel-in-progress: true |
| 15 | 21 | ||
| 16 | jobs: | 22 | jobs: |
| 23 | + core: | ||
| 24 | + name: core | ||
| 25 | + runs-on: ${{ matrix.os }} | ||
| 26 | + strategy: | ||
| 27 | + fail-fast: false | ||
| 28 | + matrix: | ||
| 29 | + os: [ubuntu-24.04-arm] | ||
| 30 | + | ||
| 31 | + steps: | ||
| 32 | + - uses: actions/checkout@v4 | ||
| 33 | + with: | ||
| 34 | + fetch-depth: 0 | ||
| 35 | + | ||
| 36 | + - name: Update version | ||
| 37 | + shell: bash | ||
| 38 | + run: | | ||
| 39 | + ./new-release.sh | ||
| 40 | + git diff . | ||
| 41 | + | ||
| 42 | + - name: Display PWD | ||
| 43 | + shell: bash | ||
| 44 | + run: | | ||
| 45 | + echo "pwd: $PWD" | ||
| 46 | + ls -lh | ||
| 47 | + du -h -d1 . | ||
| 48 | + | ||
| 49 | + - name: Build sherpa-onnx | ||
| 50 | + uses: addnab/docker-run-action@v3 | ||
| 51 | + with: | ||
| 52 | + image: quay.io/pypa/manylinux2014_aarch64 | ||
| 53 | + options: | | ||
| 54 | + --volume ${{ github.workspace }}/:/home/runner/work/sherpa-onnx/sherpa-onnx | ||
| 55 | + shell: bash | ||
| 56 | + run: | | ||
| 57 | + uname -a | ||
| 58 | + gcc --version | ||
| 59 | + cmake --version | ||
| 60 | + cat /etc/*release | ||
| 61 | + id | ||
| 62 | + pwd | ||
| 63 | + | ||
| 64 | + cd /home/runner/work/sherpa-onnx/sherpa-onnx | ||
| 65 | + | ||
| 66 | + find /opt -name "python*" | ||
| 67 | + | ||
| 68 | + echo "--------------------" | ||
| 69 | + export PATH=/opt/_internal/cpython-3.10.18/bin:$PATH | ||
| 70 | + which python3 | ||
| 71 | + python3 --version | ||
| 72 | + | ||
| 73 | + python3 -m venv my | ||
| 74 | + | ||
| 75 | + source ./my/bin/activate | ||
| 76 | + | ||
| 77 | + python3 -m pip install setuptools wheel twine | ||
| 78 | + | ||
| 79 | + git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib | ||
| 80 | + pushd alsa-lib | ||
| 81 | + ./gitcompile | ||
| 82 | + popd | ||
| 83 | + | ||
| 84 | + export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH | ||
| 85 | + export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs | ||
| 86 | + | ||
| 87 | + mkdir build | ||
| 88 | + pushd build | ||
| 89 | + | ||
| 90 | + cmake \ | ||
| 91 | + -D SHERPA_ONNX_ENABLE_TTS=ON \ | ||
| 92 | + -D CMAKE_BUILD_TYPE=Release \ | ||
| 93 | + -D BUILD_SHARED_LIBS=ON \ | ||
| 94 | + -D SHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \ | ||
| 95 | + -D CMAKE_INSTALL_PREFIX=./install \ | ||
| 96 | + .. | ||
| 97 | + | ||
| 98 | + make -j2 | ||
| 99 | + make install | ||
| 100 | + | ||
| 101 | + ls -lh lib | ||
| 102 | + ls -lh bin | ||
| 103 | + | ||
| 104 | + echo "----" | ||
| 105 | + ls -lh install/lib | ||
| 106 | + | ||
| 107 | + rm -fv install/lib/libcargs.so | ||
| 108 | + | ||
| 109 | + echo "----" | ||
| 110 | + ls -lh install/bin | ||
| 111 | + | ||
| 112 | + echo 'sherpa-onnx-core' | ||
| 113 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 114 | + cp -v ./install/lib/lib*.so ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 115 | + | ||
| 116 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 117 | + cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 118 | + | ||
| 119 | + pushd ../scripts/wheel/sherpa-onnx-core | ||
| 120 | + python3 setup.py bdist_wheel --plat-name=manylinux2014_aarch64 | ||
| 121 | + | ||
| 122 | + ls -lh dist | ||
| 123 | + | ||
| 124 | + popd | ||
| 125 | + | ||
| 126 | + echo 'sherpa-onnx-bin' | ||
| 127 | + | ||
| 128 | + mkdir -p ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 129 | + cp -v ./install/bin/sherpa-onnx* ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 130 | + | ||
| 131 | + pushd ../scripts/wheel/sherpa-onnx-bin | ||
| 132 | + python3 setup.py bdist_wheel --plat-name=manylinux2014_aarch64 | ||
| 133 | + | ||
| 134 | + ls -lh dist | ||
| 135 | + | ||
| 136 | + popd | ||
| 137 | + | ||
| 138 | + - name: Collect wheels | ||
| 139 | + shell: bash | ||
| 140 | + run: | | ||
| 141 | + sudo chown -R $USER ./scripts/wheel | ||
| 142 | + mkdir wheelhouse | ||
| 143 | + cp -v ./scripts/wheel/sherpa-onnx-core/dist/*.whl ./wheelhouse | ||
| 144 | + cp -v ./scripts/wheel/sherpa-onnx-bin/dist/*.whl ./wheelhouse | ||
| 145 | + | ||
| 146 | + - uses: actions/upload-artifact@v4 | ||
| 147 | + with: | ||
| 148 | + name: wheels-core-linux-aarch64 | ||
| 149 | + path: ./wheelhouse/*.whl | ||
| 150 | + | ||
| 151 | + - name: Show wheels | ||
| 152 | + shell: bash | ||
| 153 | + run: | | ||
| 154 | + sudo chown -R $USER ./scripts/wheel | ||
| 155 | + ls -lh ./scripts/wheel/sherpa-onnx-core/dist | ||
| 156 | + ls -lh ./scripts/wheel/sherpa-onnx-bin/dist | ||
| 157 | + | ||
| 158 | + unzip -l ./scripts/wheel/sherpa-onnx-core/dist/*.whl | ||
| 159 | + echo "---" | ||
| 160 | + unzip -l ./scripts/wheel/sherpa-onnx-bin/dist/*.whl | ||
| 161 | + | ||
| 162 | + - name: Install patchelf | ||
| 163 | + shell: bash | ||
| 164 | + run: | | ||
| 165 | + sudo apt-get update -q | ||
| 166 | + sudo apt-get install -q -y patchelf | ||
| 167 | + patchelf --help | ||
| 168 | + | ||
| 169 | + - name: Patch wheels | ||
| 170 | + shell: bash | ||
| 171 | + run: | | ||
| 172 | + mkdir ./wheels | ||
| 173 | + sudo ./scripts/wheel/patch_wheel.py --in-dir ./wheelhouse --out-dir ./wheels | ||
| 174 | + | ||
| 175 | + ls -lh ./wheels/ | ||
| 176 | + rm -rf ./wheelhouse | ||
| 177 | + mv ./wheels ./wheelhouse | ||
| 178 | + | ||
| 179 | + - uses: actions/upload-artifact@v4 | ||
| 180 | + with: | ||
| 181 | + name: wheels-core-linux-aarch64-patched | ||
| 182 | + path: ./wheelhouse/*.whl | ||
| 183 | + | ||
| 184 | + test: | ||
| 185 | + name: test | ||
| 186 | + needs: [core] | ||
| 187 | + runs-on: ${{ matrix.os }} | ||
| 188 | + strategy: | ||
| 189 | + fail-fast: false | ||
| 190 | + matrix: | ||
| 191 | + os: [ubuntu-24.04-arm] | ||
| 192 | + | ||
| 193 | + steps: | ||
| 194 | + - uses: actions/checkout@v4 | ||
| 195 | + with: | ||
| 196 | + fetch-depth: 0 | ||
| 197 | + | ||
| 198 | + - name: Retrieve artifact from Linux x64 | ||
| 199 | + uses: actions/download-artifact@v4 | ||
| 200 | + with: | ||
| 201 | + name: wheels-core-linux-aarch64-patched | ||
| 202 | + path: /tmp/wheels | ||
| 203 | + | ||
| 204 | + - name: Setup Python | ||
| 205 | + uses: actions/setup-python@v5 | ||
| 206 | + with: | ||
| 207 | + python-version: "3.10" | ||
| 208 | + | ||
| 209 | + - name: Show | ||
| 210 | + shell: bash | ||
| 211 | + run: | | ||
| 212 | + ls -lh /tmp/wheels | ||
| 213 | + | ||
| 214 | + - name: Install | ||
| 215 | + shell: bash | ||
| 216 | + run: | | ||
| 217 | + python3 -m pip install /tmp/wheels/*.whl | ||
| 218 | + | ||
| 219 | + - name: Show version | ||
| 220 | + shell: bash | ||
| 221 | + run: | | ||
| 222 | + sherpa-onnx-version | ||
| 223 | + | ||
| 224 | + - name: Show help | ||
| 225 | + shell: bash | ||
| 226 | + run: | | ||
| 227 | + sherpa-onnx --help | ||
| 228 | + | ||
| 229 | + echo "---" | ||
| 230 | + | ||
| 231 | + ls -lh $(which sherpa-onnx) | ||
| 232 | + file $(which sherpa-onnx) | ||
| 233 | + readelf -d $(which sherpa-onnx) | ||
| 234 | + | ||
| 235 | + ldd $(which sherpa-onnx) | ||
| 236 | + | ||
| 237 | + sherpa-onnx-offline --help | ||
| 238 | + | ||
| 239 | + echo "---" | ||
| 240 | + | ||
| 241 | + sherpa-onnx-vad --help | ||
| 242 | + | ||
| 243 | + - name: Publish to huggingface | ||
| 244 | + env: | ||
| 245 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 246 | + uses: nick-fields/retry@v3 | ||
| 247 | + with: | ||
| 248 | + max_attempts: 20 | ||
| 249 | + timeout_seconds: 200 | ||
| 250 | + shell: bash | ||
| 251 | + command: | | ||
| 252 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 253 | + git config --global user.name "Fangjun Kuang" | ||
| 254 | + | ||
| 255 | + rm -rf huggingface | ||
| 256 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 257 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 258 | + | ||
| 259 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 260 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 261 | + | ||
| 262 | + d=cpu/$SHERPA_ONNX_VERSION | ||
| 263 | + | ||
| 264 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface | ||
| 265 | + cd huggingface | ||
| 266 | + git fetch | ||
| 267 | + git pull | ||
| 268 | + git merge -m "merge remote" --ff origin main | ||
| 269 | + | ||
| 270 | + mkdir -p $d | ||
| 271 | + | ||
| 272 | + cp -v /tmp/wheels/*.whl $d/ | ||
| 273 | + | ||
| 274 | + git status | ||
| 275 | + git add . | ||
| 276 | + git commit -m "add more wheels" | ||
| 277 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | ||
| 278 | + | ||
| 279 | + - name: Publish wheels to PyPI ${{ github.event.inputs.publish_sherpa_onnx_bin }} | ||
| 280 | + if: ${{ (github.event.inputs.publish_sherpa_onnx_bin || 'true') == 'true' }} | ||
| 281 | + env: | ||
| 282 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| 283 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| 284 | + shell: bash | ||
| 285 | + run: | | ||
| 286 | + python3 -m pip install --upgrade pip | ||
| 287 | + python3 -m pip install wheel twine==5.0.0 setuptools | ||
| 288 | + | ||
| 289 | + twine upload /tmp/wheels/*.whl | ||
| 290 | + | ||
| 291 | + | ||
| 17 | build_wheels_aarch64: | 292 | build_wheels_aarch64: |
| 293 | + needs: [core, test] | ||
| 18 | name: ${{ matrix.manylinux }} ${{ matrix.python-version }} | 294 | name: ${{ matrix.manylinux }} ${{ matrix.python-version }} |
| 19 | runs-on: ${{ matrix.os }} | 295 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 296 | strategy: |
| @@ -22,8 +298,8 @@ jobs: | @@ -22,8 +298,8 @@ jobs: | ||
| 22 | matrix: | 298 | matrix: |
| 23 | # see https://github.com/pypa/cibuildwheel/issues/2257 | 299 | # see https://github.com/pypa/cibuildwheel/issues/2257 |
| 24 | # we don't use qemu from now on | 300 | # we don't use qemu from now on |
| 25 | - os: [ubuntu-22.04-arm] | ||
| 26 | - python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | 301 | + os: [ubuntu-24.04-arm] |
| 302 | + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] | ||
| 27 | manylinux: [manylinux2014] #, manylinux_2_28] | 303 | manylinux: [manylinux2014] #, manylinux_2_28] |
| 28 | 304 | ||
| 29 | steps: | 305 | steps: |
| @@ -38,7 +314,7 @@ jobs: | @@ -38,7 +314,7 @@ jobs: | ||
| 38 | # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ | 314 | # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ |
| 39 | # for a list of versions | 315 | # for a list of versions |
| 40 | - name: Build wheels | 316 | - name: Build wheels |
| 41 | - uses: pypa/cibuildwheel@v2.21.3 | 317 | + uses: pypa/cibuildwheel@v3.1.4 |
| 42 | env: | 318 | env: |
| 43 | CIBW_BEFORE_ALL: | | 319 | CIBW_BEFORE_ALL: | |
| 44 | git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib | 320 | git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib |
| @@ -48,7 +324,15 @@ jobs: | @@ -48,7 +324,15 @@ jobs: | ||
| 48 | echo "PWD" | 324 | echo "PWD" |
| 49 | ls -lh /project/alsa-lib/src/.libs | 325 | ls -lh /project/alsa-lib/src/.libs |
| 50 | 326 | ||
| 51 | - CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1" SHERPA_ONNX_ENABLE_ALSA=1 | 327 | + CIBW_ENVIRONMENT: > |
| 328 | + SHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON | ||
| 329 | + CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH | ||
| 330 | + SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs | ||
| 331 | + LD_LIBRARY_PATH=/project/build/bdist.linux-aarch64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR | ||
| 332 | + SHERPA_ONNX_MAKE_ARGS="VERBOSE=1" | ||
| 333 | + SHERPA_ONNX_ENABLE_ALSA=1 | ||
| 334 | + SHERPA_ONNX_CMAKE_ARGS="-DSHERPA_ONNX_ENABLE_BINARY=OFF -DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" | ||
| 335 | + | ||
| 52 | CIBW_BUILD: "${{ matrix.python-version}}-* " | 336 | CIBW_BUILD: "${{ matrix.python-version}}-* " |
| 53 | CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" | 337 | CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" |
| 54 | CIBW_BUILD_VERBOSITY: 3 | 338 | CIBW_BUILD_VERBOSITY: 3 |
| @@ -57,28 +341,38 @@ jobs: | @@ -57,28 +341,38 @@ jobs: | ||
| 57 | CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/${{ matrix.manylinux }}_aarch64 | 341 | CIBW_MANYLINUX_AARCH64_IMAGE: quay.io/pypa/${{ matrix.manylinux }}_aarch64 |
| 58 | # From onnxruntime >= 1.17.0, it drops support for CentOS 7.0 and it supports only manylinux_2_28. | 342 | # From onnxruntime >= 1.17.0, it drops support for CentOS 7.0 and it supports only manylinux_2_28. |
| 59 | # manylinux_2_24 is no longer supported | 343 | # manylinux_2_24 is no longer supported |
| 344 | + CIBW_REPAIR_WHEEL_COMMAND: > | ||
| 345 | + auditwheel repair -w {dest_dir} | ||
| 346 | + --exclude libonnxruntime.so | ||
| 347 | + {wheel} | ||
| 348 | + | ||
| 349 | + - uses: actions/upload-artifact@v4 | ||
| 350 | + with: | ||
| 351 | + name: wheel-${{ matrix.python-version }}-${{ matrix.manylinux }}-linux-aarch64 | ||
| 352 | + path: ./wheelhouse/*.whl | ||
| 60 | 353 | ||
| 61 | - name: Display wheels | 354 | - name: Display wheels |
| 62 | shell: bash | 355 | shell: bash |
| 63 | run: | | 356 | run: | |
| 64 | ls -lh ./wheelhouse/ | 357 | ls -lh ./wheelhouse/ |
| 65 | 358 | ||
| 66 | - - name: Install patchelf | 359 | + - name: Show wheels |
| 67 | shell: bash | 360 | shell: bash |
| 68 | run: | | 361 | run: | |
| 69 | - sudo apt-get update -q | ||
| 70 | - sudo apt-get install -q -y patchelf | ||
| 71 | - patchelf --help | 362 | + ls -lh wheelhouse/*.whl |
| 72 | 363 | ||
| 73 | - - name: Patch wheels | ||
| 74 | - shell: bash | ||
| 75 | - run: | | ||
| 76 | - mkdir ./wheels | ||
| 77 | - sudo ./scripts/wheel/patch_wheel.py --in-dir ./wheelhouse --out-dir ./wheels | 364 | + unzip -l wheelhouse/*.whl |
| 78 | 365 | ||
| 79 | - ls -lh ./wheels/ | ||
| 80 | - rm -rf ./wheelhouse | ||
| 81 | - mv ./wheels ./wheelhouse | 366 | + echo "---" |
| 367 | + | ||
| 368 | + mkdir t | ||
| 369 | + cp wheelhouse/*.whl ./t | ||
| 370 | + cd ./t | ||
| 371 | + unzip ./*.whl | ||
| 372 | + ls -lh | ||
| 373 | + echo "---" | ||
| 374 | + | ||
| 375 | + readelf -d sherpa_onnx/lib/*.so | ||
| 82 | 376 | ||
| 83 | - name: Publish to huggingface | 377 | - name: Publish to huggingface |
| 84 | env: | 378 | env: |
| @@ -116,11 +410,6 @@ jobs: | @@ -116,11 +410,6 @@ jobs: | ||
| 116 | git commit -m "add more wheels" | 410 | git commit -m "add more wheels" |
| 117 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | 411 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main |
| 118 | 412 | ||
| 119 | - - uses: actions/upload-artifact@v4 | ||
| 120 | - with: | ||
| 121 | - name: wheel-${{ matrix.python-version }}-${{ matrix.manylinux }} | ||
| 122 | - path: ./wheelhouse/*.whl | ||
| 123 | - | ||
| 124 | - name: Publish wheels to PyPI | 413 | - name: Publish wheels to PyPI |
| 125 | env: | 414 | env: |
| 126 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | 415 | TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} |
| @@ -15,13 +15,14 @@ concurrency: | @@ -15,13 +15,14 @@ concurrency: | ||
| 15 | 15 | ||
| 16 | jobs: | 16 | jobs: |
| 17 | build_wheels_linux_cuda: | 17 | build_wheels_linux_cuda: |
| 18 | - name: ${{ matrix.manylinux }} ${{ matrix.python-version }} | 18 | + name: ${{ matrix.manylinux }} ${{ matrix.python-version }} ${{ matrix.onnxruntime_version }} |
| 19 | runs-on: ${{ matrix.os }} | 19 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 20 | strategy: |
| 21 | fail-fast: false | 21 | fail-fast: false |
| 22 | matrix: | 22 | matrix: |
| 23 | os: [ubuntu-22.04] | 23 | os: [ubuntu-22.04] |
| 24 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | 24 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] |
| 25 | + onnxruntime_version: ["1.17.1", "1.22.0"] | ||
| 25 | 26 | ||
| 26 | steps: | 27 | steps: |
| 27 | - uses: actions/checkout@v4 | 28 | - uses: actions/checkout@v4 |
| @@ -69,6 +70,16 @@ jobs: | @@ -69,6 +70,16 @@ jobs: | ||
| 69 | export SHERPA_ONNX_ENABLE_ALSA=1 | 70 | export SHERPA_ONNX_ENABLE_ALSA=1 |
| 70 | export SHERPA_ONNX_CMAKE_ARGS="-DSHERPA_ONNX_ENABLE_GPU=ON" | 71 | export SHERPA_ONNX_CMAKE_ARGS="-DSHERPA_ONNX_ENABLE_GPU=ON" |
| 71 | 72 | ||
| 73 | + onnxruntime_version=${{ matrix.onnxruntime_version }} | ||
| 74 | + if [[ $onnxruntime_version == "1.22.0" ]]; then | ||
| 75 | + curl -SL -O https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.22.0/onnxruntime-linux-x64-gpu-1.22.0-patched.zip | ||
| 76 | + unzip onnxruntime-linux-x64-gpu-1.22.0-patched.zip | ||
| 77 | + | ||
| 78 | + export SHERPA_ONNXRUNTIME_LIB_DIR=$PWD/onnxruntime-linux-x64-gpu-1.22.0-patched/lib | ||
| 79 | + export SHERPA_ONNXRUNTIME_INCLUDE_DIR=$PWD/onnxruntime-linux-x64-gpu-1.22.0-patched/include | ||
| 80 | + export SHERPA_ONNX_CUDA_VERSION="12.cudnn9" | ||
| 81 | + fi | ||
| 82 | + | ||
| 72 | python3 setup.py bdist_wheel | 83 | python3 setup.py bdist_wheel |
| 73 | 84 | ||
| 74 | ls -lh dist | 85 | ls -lh dist |
| @@ -80,6 +91,8 @@ jobs: | @@ -80,6 +91,8 @@ jobs: | ||
| 80 | run: | | 91 | run: | |
| 81 | ls -lh ./wheelhouse/ | 92 | ls -lh ./wheelhouse/ |
| 82 | 93 | ||
| 94 | + unzip -l ./wheelhouse/*.whl | ||
| 95 | + | ||
| 83 | - name: Install patchelf | 96 | - name: Install patchelf |
| 84 | shell: bash | 97 | shell: bash |
| 85 | run: | | 98 | run: | |
| @@ -97,9 +110,10 @@ jobs: | @@ -97,9 +110,10 @@ jobs: | ||
| 97 | rm -rf ./wheelhouse | 110 | rm -rf ./wheelhouse |
| 98 | mv ./wheels ./wheelhouse | 111 | mv ./wheels ./wheelhouse |
| 99 | 112 | ||
| 113 | + | ||
| 100 | - uses: actions/upload-artifact@v4 | 114 | - uses: actions/upload-artifact@v4 |
| 101 | with: | 115 | with: |
| 102 | - name: wheel-cuda-${{ matrix.python-version }} | 116 | + name: wheel-cuda-${{ matrix.python-version }}-${{ matrix.onnxruntime_version }} |
| 103 | path: ./wheelhouse/*.whl | 117 | path: ./wheelhouse/*.whl |
| 104 | 118 | ||
| 105 | - name: Publish to huggingface | 119 | - name: Publish to huggingface |
| @@ -5,6 +5,12 @@ on: | @@ -5,6 +5,12 @@ on: | ||
| 5 | branches: | 5 | branches: |
| 6 | - wheel | 6 | - wheel |
| 7 | workflow_dispatch: | 7 | workflow_dispatch: |
| 8 | + inputs: | ||
| 9 | + publish_sherpa_onnx_bin: | ||
| 10 | + description: "Publish sherpa-onnx-bin" | ||
| 11 | + required: false | ||
| 12 | + default: "true" | ||
| 13 | + type: boolean | ||
| 8 | 14 | ||
| 9 | env: | 15 | env: |
| 10 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 | 16 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 |
| @@ -14,19 +20,18 @@ concurrency: | @@ -14,19 +20,18 @@ concurrency: | ||
| 14 | cancel-in-progress: true | 20 | cancel-in-progress: true |
| 15 | 21 | ||
| 16 | jobs: | 22 | jobs: |
| 17 | - build_wheels_linux: | ||
| 18 | - name: ${{ matrix.manylinux }} ${{ matrix.python-version }} | 23 | + core: |
| 24 | + name: core | ||
| 19 | runs-on: ${{ matrix.os }} | 25 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 26 | strategy: |
| 21 | fail-fast: false | 27 | fail-fast: false |
| 22 | matrix: | 28 | matrix: |
| 23 | - os: [ubuntu-22.04] | ||
| 24 | - python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | ||
| 25 | - manylinux: [manylinux2014] #, manylinux_2_28] | ||
| 26 | - | 29 | + os: [ubuntu-latest] |
| 27 | 30 | ||
| 28 | steps: | 31 | steps: |
| 29 | - uses: actions/checkout@v4 | 32 | - uses: actions/checkout@v4 |
| 33 | + with: | ||
| 34 | + fetch-depth: 0 | ||
| 30 | 35 | ||
| 31 | - name: Update version | 36 | - name: Update version |
| 32 | shell: bash | 37 | shell: bash |
| @@ -34,30 +39,127 @@ jobs: | @@ -34,30 +39,127 @@ jobs: | ||
| 34 | ./new-release.sh | 39 | ./new-release.sh |
| 35 | git diff . | 40 | git diff . |
| 36 | 41 | ||
| 37 | - # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ | ||
| 38 | - # for a list of versions | ||
| 39 | - - name: Build wheels | ||
| 40 | - uses: pypa/cibuildwheel@v2.21.3 | ||
| 41 | - env: | ||
| 42 | - CIBW_BEFORE_ALL: | | ||
| 43 | - git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib | ||
| 44 | - cd alsa-lib | ||
| 45 | - ./gitcompile | ||
| 46 | - cd .. | ||
| 47 | - echo "PWD" | ||
| 48 | - ls -lh /project/alsa-lib/src/.libs | 42 | + - name: Display PWD |
| 43 | + shell: bash | ||
| 44 | + run: | | ||
| 45 | + echo "pwd: $PWD" | ||
| 46 | + ls -lh | ||
| 47 | + du -h -d1 . | ||
| 49 | 48 | ||
| 50 | - CIBW_ENVIRONMENT: CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR SHERPA_ONNX_MAKE_ARGS="VERBOSE=1" SHERPA_ONNX_ENABLE_ALSA=1 | 49 | + - name: Build sherpa-onnx |
| 50 | + uses: addnab/docker-run-action@v3 | ||
| 51 | + with: | ||
| 52 | + image: quay.io/pypa/manylinux2014_x86_64 | ||
| 53 | + options: | | ||
| 54 | + --volume ${{ github.workspace }}/:/home/runner/work/sherpa-onnx/sherpa-onnx | ||
| 55 | + shell: bash | ||
| 56 | + run: | | ||
| 57 | + uname -a | ||
| 58 | + gcc --version | ||
| 59 | + cmake --version | ||
| 60 | + cat /etc/*release | ||
| 61 | + id | ||
| 62 | + pwd | ||
| 51 | 63 | ||
| 52 | - CIBW_BUILD: "${{ matrix.python-version}}-* " | ||
| 53 | - CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" | ||
| 54 | - CIBW_BUILD_VERBOSITY: 3 | ||
| 55 | - CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/${{ matrix.manylinux }}_x86_64 | 64 | + cd /home/runner/work/sherpa-onnx/sherpa-onnx |
| 65 | + | ||
| 66 | + find /opt -name "python*" | ||
| 67 | + | ||
| 68 | + echo "--------------------" | ||
| 69 | + export PATH=/opt/_internal/cpython-3.10.18/bin:$PATH | ||
| 70 | + which python3 | ||
| 71 | + python3 --version | ||
| 72 | + | ||
| 73 | + python3 -m venv my | ||
| 74 | + | ||
| 75 | + source ./my/bin/activate | ||
| 76 | + | ||
| 77 | + python3 -m pip install setuptools wheel twine | ||
| 78 | + | ||
| 79 | + git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib | ||
| 80 | + pushd alsa-lib | ||
| 81 | + ./gitcompile | ||
| 82 | + popd | ||
| 83 | + | ||
| 84 | + export CPLUS_INCLUDE_PATH=$PWD/alsa-lib/include:$CPLUS_INCLUDE_PATH | ||
| 85 | + export SHERPA_ONNX_ALSA_LIB_DIR=$PWD/alsa-lib/src/.libs | ||
| 86 | + | ||
| 87 | + mkdir build | ||
| 88 | + pushd build | ||
| 89 | + | ||
| 90 | + cmake \ | ||
| 91 | + -D SHERPA_ONNX_ENABLE_TTS=ON \ | ||
| 92 | + -D CMAKE_BUILD_TYPE=Release \ | ||
| 93 | + -D BUILD_SHARED_LIBS=ON \ | ||
| 94 | + -D SHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \ | ||
| 95 | + -D CMAKE_INSTALL_PREFIX=./install \ | ||
| 96 | + .. | ||
| 97 | + | ||
| 98 | + make -j2 | ||
| 99 | + make install | ||
| 100 | + | ||
| 101 | + ls -lh lib | ||
| 102 | + ls -lh bin | ||
| 103 | + | ||
| 104 | + echo "----" | ||
| 105 | + ls -lh install/lib | ||
| 106 | + | ||
| 107 | + rm -fv install/lib/libcargs.so | ||
| 108 | + | ||
| 109 | + echo "----" | ||
| 110 | + ls -lh install/bin | ||
| 111 | + | ||
| 112 | + echo 'sherpa-onnx-core' | ||
| 113 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 114 | + cp -v ./install/lib/lib*.so ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 115 | + | ||
| 116 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 117 | + cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 118 | + | ||
| 119 | + pushd ../scripts/wheel/sherpa-onnx-core | ||
| 120 | + python3 setup.py bdist_wheel --plat-name=manylinux2014_x86_64 | ||
| 121 | + | ||
| 122 | + ls -lh dist | ||
| 123 | + unzip -l dist/*.whl | ||
| 124 | + | ||
| 125 | + popd | ||
| 126 | + | ||
| 127 | + echo 'sherpa-onnx-bin' | ||
| 128 | + | ||
| 129 | + mkdir -p ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 130 | + cp -v ./install/bin/sherpa-onnx* ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 56 | 131 | ||
| 57 | - - name: Display wheels | 132 | + pushd ../scripts/wheel/sherpa-onnx-bin |
| 133 | + python3 setup.py bdist_wheel --plat-name=manylinux2014_x86_64 | ||
| 134 | + | ||
| 135 | + ls -lh dist | ||
| 136 | + unzip -l dist/*.whl | ||
| 137 | + | ||
| 138 | + popd | ||
| 139 | + | ||
| 140 | + - name: Collect wheels | ||
| 58 | shell: bash | 141 | shell: bash |
| 59 | run: | | 142 | run: | |
| 60 | - ls -lh ./wheelhouse/ | 143 | + sudo chown -R $USER ./scripts/wheel |
| 144 | + mkdir wheelhouse | ||
| 145 | + cp -v ./scripts/wheel/sherpa-onnx-core/dist/*.whl ./wheelhouse | ||
| 146 | + cp -v ./scripts/wheel/sherpa-onnx-bin/dist/*.whl ./wheelhouse | ||
| 147 | + | ||
| 148 | + - uses: actions/upload-artifact@v4 | ||
| 149 | + with: | ||
| 150 | + name: wheels-core-linux-x64 | ||
| 151 | + path: ./wheelhouse/*.whl | ||
| 152 | + | ||
| 153 | + - name: Show wheels | ||
| 154 | + shell: bash | ||
| 155 | + run: | | ||
| 156 | + sudo chown -R $USER ./scripts/wheel | ||
| 157 | + ls -lh ./scripts/wheel/sherpa-onnx-core/dist | ||
| 158 | + ls -lh ./scripts/wheel/sherpa-onnx-bin/dist | ||
| 159 | + | ||
| 160 | + unzip -l ./scripts/wheel/sherpa-onnx-core/dist/*.whl | ||
| 161 | + echo "---" | ||
| 162 | + unzip -l ./scripts/wheel/sherpa-onnx-bin/dist/*.whl | ||
| 61 | 163 | ||
| 62 | - name: Install patchelf | 164 | - name: Install patchelf |
| 63 | shell: bash | 165 | shell: bash |
| @@ -78,9 +180,189 @@ jobs: | @@ -78,9 +180,189 @@ jobs: | ||
| 78 | 180 | ||
| 79 | - uses: actions/upload-artifact@v4 | 181 | - uses: actions/upload-artifact@v4 |
| 80 | with: | 182 | with: |
| 183 | + name: wheels-core-linux-x64-patched | ||
| 184 | + path: ./wheelhouse/*.whl | ||
| 185 | + | ||
| 186 | + test: | ||
| 187 | + name: test | ||
| 188 | + needs: [core] | ||
| 189 | + runs-on: ${{ matrix.os }} | ||
| 190 | + strategy: | ||
| 191 | + fail-fast: false | ||
| 192 | + matrix: | ||
| 193 | + os: [ubuntu-latest] | ||
| 194 | + | ||
| 195 | + steps: | ||
| 196 | + - uses: actions/checkout@v4 | ||
| 197 | + with: | ||
| 198 | + fetch-depth: 0 | ||
| 199 | + | ||
| 200 | + - name: Retrieve artifact from Linux x64 | ||
| 201 | + uses: actions/download-artifact@v4 | ||
| 202 | + with: | ||
| 203 | + name: wheels-core-linux-x64-patched | ||
| 204 | + path: /tmp/wheels | ||
| 205 | + | ||
| 206 | + - name: Setup Python | ||
| 207 | + uses: actions/setup-python@v5 | ||
| 208 | + with: | ||
| 209 | + python-version: "3.10" | ||
| 210 | + | ||
| 211 | + - name: Show | ||
| 212 | + shell: bash | ||
| 213 | + run: | | ||
| 214 | + ls -lh /tmp/wheels | ||
| 215 | + | ||
| 216 | + - name: Install | ||
| 217 | + shell: bash | ||
| 218 | + run: | | ||
| 219 | + python3 -m pip install /tmp/wheels/*.whl | ||
| 220 | + | ||
| 221 | + - name: Show version | ||
| 222 | + shell: bash | ||
| 223 | + run: | | ||
| 224 | + sherpa-onnx-version | ||
| 225 | + | ||
| 226 | + - name: Show help | ||
| 227 | + shell: bash | ||
| 228 | + run: | | ||
| 229 | + sherpa-onnx --help | ||
| 230 | + | ||
| 231 | + echo "---" | ||
| 232 | + | ||
| 233 | + ls -lh $(which sherpa-onnx) | ||
| 234 | + file $(which sherpa-onnx) | ||
| 235 | + readelf -d $(which sherpa-onnx) | ||
| 236 | + | ||
| 237 | + ldd $(which sherpa-onnx) | ||
| 238 | + | ||
| 239 | + sherpa-onnx-offline --help | ||
| 240 | + | ||
| 241 | + echo "---" | ||
| 242 | + | ||
| 243 | + sherpa-onnx-vad --help | ||
| 244 | + | ||
| 245 | + - name: Publish to huggingface | ||
| 246 | + env: | ||
| 247 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 248 | + uses: nick-fields/retry@v3 | ||
| 249 | + with: | ||
| 250 | + max_attempts: 20 | ||
| 251 | + timeout_seconds: 200 | ||
| 252 | + shell: bash | ||
| 253 | + command: | | ||
| 254 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 255 | + git config --global user.name "Fangjun Kuang" | ||
| 256 | + | ||
| 257 | + rm -rf huggingface | ||
| 258 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 259 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 260 | + | ||
| 261 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 262 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 263 | + | ||
| 264 | + d=cpu/$SHERPA_ONNX_VERSION | ||
| 265 | + | ||
| 266 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface | ||
| 267 | + cd huggingface | ||
| 268 | + git fetch | ||
| 269 | + git pull | ||
| 270 | + git merge -m "merge remote" --ff origin main | ||
| 271 | + | ||
| 272 | + mkdir -p $d | ||
| 273 | + | ||
| 274 | + cp -v /tmp/wheels/*.whl $d/ | ||
| 275 | + | ||
| 276 | + git status | ||
| 277 | + git add . | ||
| 278 | + git commit -m "add more wheels" | ||
| 279 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | ||
| 280 | + | ||
| 281 | + - name: Publish wheels to PyPI ${{ github.event.inputs.publish_sherpa_onnx_bin }} | ||
| 282 | + if: ${{ (github.event.inputs.publish_sherpa_onnx_bin || 'true') == 'true' }} | ||
| 283 | + env: | ||
| 284 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| 285 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| 286 | + shell: bash | ||
| 287 | + run: | | ||
| 288 | + python3 -m pip install --upgrade pip | ||
| 289 | + python3 -m pip install wheel twine==5.0.0 setuptools | ||
| 290 | + | ||
| 291 | + twine upload /tmp/wheels/*.whl | ||
| 292 | + | ||
| 293 | + build_wheels_linux: | ||
| 294 | + needs: [core, test] | ||
| 295 | + name: ${{ matrix.manylinux }} ${{ matrix.python-version }} | ||
| 296 | + runs-on: ${{ matrix.os }} | ||
| 297 | + strategy: | ||
| 298 | + fail-fast: false | ||
| 299 | + matrix: | ||
| 300 | + os: [ubuntu-latest] | ||
| 301 | + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] | ||
| 302 | + manylinux: [manylinux2014] #, manylinux_2_28] | ||
| 303 | + | ||
| 304 | + steps: | ||
| 305 | + - uses: actions/checkout@v4 | ||
| 306 | + | ||
| 307 | + - name: Update version | ||
| 308 | + shell: bash | ||
| 309 | + run: | | ||
| 310 | + ./new-release.sh | ||
| 311 | + git diff . | ||
| 312 | + | ||
| 313 | + # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ | ||
| 314 | + # for a list of versions | ||
| 315 | + - name: Build wheels | ||
| 316 | + uses: pypa/cibuildwheel@v3.1.4 | ||
| 317 | + env: | ||
| 318 | + CIBW_BEFORE_ALL: | | ||
| 319 | + git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib | ||
| 320 | + cd alsa-lib | ||
| 321 | + ./gitcompile | ||
| 322 | + cd .. | ||
| 323 | + echo "PWD" | ||
| 324 | + ls -lh /project/alsa-lib/src/.libs | ||
| 325 | + | ||
| 326 | + CIBW_ENVIRONMENT: > | ||
| 327 | + SHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON | ||
| 328 | + CPLUS_INCLUDE_PATH=/project/alsa-lib/include:$CPLUS_INCLUDE_PATH | ||
| 329 | + SHERPA_ONNX_ALSA_LIB_DIR=/project/alsa-lib/src/.libs | ||
| 330 | + LD_LIBRARY_PATH=/project/build/bdist.linux-x86_64/wheel/sherpa_onnx/lib:$SHERPA_ONNX_ALSA_LIB_DIR | ||
| 331 | + SHERPA_ONNX_MAKE_ARGS="VERBOSE=1" | ||
| 332 | + SHERPA_ONNX_ENABLE_ALSA=1 | ||
| 333 | + SHERPA_ONNX_CMAKE_ARGS="-DSHERPA_ONNX_ENABLE_BINARY=OFF -DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" | ||
| 334 | + | ||
| 335 | + CIBW_BUILD: "${{ matrix.python-version}}-* " | ||
| 336 | + CIBW_SKIP: "cp27-* cp35-* cp36-* *-win32 pp* *-musllinux* *-manylinux_i686" | ||
| 337 | + CIBW_BUILD_VERBOSITY: 3 | ||
| 338 | + CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/${{ matrix.manylinux }}_x86_64 | ||
| 339 | + CIBW_REPAIR_WHEEL_COMMAND: > | ||
| 340 | + auditwheel repair -w {dest_dir} | ||
| 341 | + --exclude libonnxruntime.so | ||
| 342 | + {wheel} | ||
| 343 | + | ||
| 344 | + - uses: actions/upload-artifact@v4 | ||
| 345 | + with: | ||
| 81 | name: wheel-${{ matrix.python-version }}-${{ matrix.manylinux }} | 346 | name: wheel-${{ matrix.python-version }}-${{ matrix.manylinux }} |
| 82 | path: ./wheelhouse/*.whl | 347 | path: ./wheelhouse/*.whl |
| 83 | 348 | ||
| 349 | + - name: Show wheels | ||
| 350 | + shell: bash | ||
| 351 | + run: | | ||
| 352 | + ls -lh wheelhouse/*.whl | ||
| 353 | + unzip -l wheelhouse/*.whl | ||
| 354 | + | ||
| 355 | + echo "---" | ||
| 356 | + | ||
| 357 | + mkdir t | ||
| 358 | + cp wheelhouse/*.whl ./t | ||
| 359 | + cd ./t | ||
| 360 | + unzip ./*.whl | ||
| 361 | + ls -lh | ||
| 362 | + echo "---" | ||
| 363 | + | ||
| 364 | + readelf -d sherpa_onnx/lib/*.so | ||
| 365 | + | ||
| 84 | - name: Publish to huggingface | 366 | - name: Publish to huggingface |
| 85 | env: | 367 | env: |
| 86 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 368 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| @@ -5,6 +5,12 @@ on: | @@ -5,6 +5,12 @@ on: | ||
| 5 | branches: | 5 | branches: |
| 6 | - wheel | 6 | - wheel |
| 7 | workflow_dispatch: | 7 | workflow_dispatch: |
| 8 | + inputs: | ||
| 9 | + publish_sherpa_onnx_bin: | ||
| 10 | + description: "Publish sherpa-onnx-bin" | ||
| 11 | + required: false | ||
| 12 | + default: "true" | ||
| 13 | + type: boolean | ||
| 8 | 14 | ||
| 9 | env: | 15 | env: |
| 10 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 | 16 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 |
| @@ -14,14 +20,246 @@ concurrency: | @@ -14,14 +20,246 @@ concurrency: | ||
| 14 | cancel-in-progress: true | 20 | cancel-in-progress: true |
| 15 | 21 | ||
| 16 | jobs: | 22 | jobs: |
| 23 | + core: | ||
| 24 | + runs-on: ${{ matrix.os }} | ||
| 25 | + name: core | ||
| 26 | + strategy: | ||
| 27 | + fail-fast: false | ||
| 28 | + matrix: | ||
| 29 | + os: [macos-latest] | ||
| 30 | + | ||
| 31 | + steps: | ||
| 32 | + - uses: actions/checkout@v4 | ||
| 33 | + with: | ||
| 34 | + fetch-depth: 0 | ||
| 35 | + | ||
| 36 | + - name: Update version | ||
| 37 | + shell: bash | ||
| 38 | + run: | | ||
| 39 | + ./new-release.sh | ||
| 40 | + git diff . | ||
| 41 | + - name: Set up Python | ||
| 42 | + uses: actions/setup-python@v5 | ||
| 43 | + with: | ||
| 44 | + python-version: "3.10" | ||
| 45 | + | ||
| 46 | + - name: Install deps | ||
| 47 | + shell: bash | ||
| 48 | + run: | | ||
| 49 | + python3 -m pip install setuptools wheel twine | ||
| 50 | + | ||
| 51 | + - name: ccache | ||
| 52 | + uses: hendrikmuhs/ccache-action@v1.2 | ||
| 53 | + with: | ||
| 54 | + key: macos-latest-sherpa-onnx-core-arm64 | ||
| 55 | + | ||
| 56 | + - name: Configure CMake | ||
| 57 | + shell: bash | ||
| 58 | + run: | | ||
| 59 | + export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
| 60 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| 61 | + cmake --version | ||
| 62 | + | ||
| 63 | + mkdir build | ||
| 64 | + cd build | ||
| 65 | + | ||
| 66 | + cmake \ | ||
| 67 | + -DSHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON \ | ||
| 68 | + -D BUILD_SHARED_LIBS=ON \ | ||
| 69 | + -D SHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \ | ||
| 70 | + -D CMAKE_BUILD_TYPE=Release \ | ||
| 71 | + -D CMAKE_OSX_ARCHITECTURES='arm64' \ | ||
| 72 | + -D CMAKE_INSTALL_PREFIX=./install \ | ||
| 73 | + .. | ||
| 74 | + | ||
| 75 | + - name: Build sherpa-onnx for macos | ||
| 76 | + shell: bash | ||
| 77 | + run: | | ||
| 78 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| 79 | + | ||
| 80 | + cd build | ||
| 81 | + make -j2 | ||
| 82 | + make install | ||
| 83 | + | ||
| 84 | + ls -lh lib | ||
| 85 | + ls -lh bin | ||
| 86 | + | ||
| 87 | + file ./bin/sherpa-onnx | ||
| 88 | + | ||
| 89 | + rm -fv ./install/include/cargs.h | ||
| 90 | + rm -fv ./install/lib/cargs.h | ||
| 91 | + rm -fv ./install/lib/libcargs.dylib | ||
| 92 | + rm -fv ./install/lib/libcargs.a | ||
| 93 | + rm -rfv ./install/lib/pkgconfig | ||
| 94 | + | ||
| 95 | + - name: Copy files | ||
| 96 | + shell: bash | ||
| 97 | + run: | | ||
| 98 | + echo 'sherpa-onnx-core' | ||
| 99 | + mkdir -p scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 100 | + cp -v ./build/install/lib/lib* ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 101 | + | ||
| 102 | + mkdir -p ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 103 | + cp -v ./build/install/include/sherpa-onnx/c-api/*.h ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 104 | + | ||
| 105 | + echo 'sherpa-onnx-bin' | ||
| 106 | + | ||
| 107 | + mkdir -p ./scripts/wheel/sherpa-onnx-bin/bin | ||
| 108 | + cp -v ./build/install/bin/sherpa-onnx* ./scripts/wheel/sherpa-onnx-bin/bin | ||
| 109 | + | ||
| 110 | + - name: Build sherpa-onnx-core | ||
| 111 | + shell: bash | ||
| 112 | + run: | | ||
| 113 | + pushd ./scripts/wheel/sherpa-onnx-core | ||
| 114 | + python3 setup.py bdist_wheel --plat-name=macosx_11_0_arm64 | ||
| 115 | + | ||
| 116 | + ls -lh dist | ||
| 117 | + unzip -l dist/*.whl | ||
| 118 | + | ||
| 119 | + popd | ||
| 120 | + | ||
| 121 | + - name: Build sherpa-onnx-bin | ||
| 122 | + shell: bash | ||
| 123 | + run: | | ||
| 124 | + pushd ./scripts/wheel/sherpa-onnx-bin | ||
| 125 | + python3 setup.py bdist_wheel --plat-name=macosx_11_0_arm64 | ||
| 126 | + | ||
| 127 | + ls -lh dist | ||
| 128 | + unzip -l dist/*.whl | ||
| 129 | + | ||
| 130 | + popd | ||
| 131 | + | ||
| 132 | + - name: Collect wheels | ||
| 133 | + shell: bash | ||
| 134 | + run: | | ||
| 135 | + cp -v ./scripts/wheel/sherpa-onnx-core/dist/*.whl . | ||
| 136 | + cp -v ./scripts/wheel/sherpa-onnx-bin/dist/*.whl . | ||
| 137 | + | ||
| 138 | + ls -lh *.whl | ||
| 139 | + | ||
| 140 | + - uses: actions/upload-artifact@v4 | ||
| 141 | + with: | ||
| 142 | + name: wheels-core-macos-arm64 | ||
| 143 | + path: ./*.whl | ||
| 144 | + | ||
| 145 | + test: | ||
| 146 | + name: test | ||
| 147 | + needs: [core] | ||
| 148 | + runs-on: ${{ matrix.os }} | ||
| 149 | + strategy: | ||
| 150 | + fail-fast: false | ||
| 151 | + matrix: | ||
| 152 | + os: [macos-latest] | ||
| 153 | + | ||
| 154 | + steps: | ||
| 155 | + - uses: actions/checkout@v4 | ||
| 156 | + with: | ||
| 157 | + fetch-depth: 0 | ||
| 158 | + | ||
| 159 | + - name: Retrieve artifact from macos arm64 | ||
| 160 | + uses: actions/download-artifact@v4 | ||
| 161 | + with: | ||
| 162 | + name: wheels-core-macos-arm64 | ||
| 163 | + path: /tmp/wheels | ||
| 164 | + | ||
| 165 | + - name: Setup Python | ||
| 166 | + uses: actions/setup-python@v5 | ||
| 167 | + with: | ||
| 168 | + python-version: "3.10" | ||
| 169 | + | ||
| 170 | + - name: Show | ||
| 171 | + shell: bash | ||
| 172 | + run: | | ||
| 173 | + ls -lh /tmp/wheels | ||
| 174 | + | ||
| 175 | + - name: Install | ||
| 176 | + shell: bash | ||
| 177 | + run: | | ||
| 178 | + python3 -m pip install /tmp/wheels/*.whl | ||
| 179 | + | ||
| 180 | + - name: Show version | ||
| 181 | + shell: bash | ||
| 182 | + run: | | ||
| 183 | + sherpa-onnx-version | ||
| 184 | + | ||
| 185 | + - name: Show help | ||
| 186 | + shell: bash | ||
| 187 | + run: | | ||
| 188 | + sherpa-onnx --help | ||
| 189 | + | ||
| 190 | + ls -lh $(which sherpa-onnx) | ||
| 191 | + file $(which sherpa-onnx) | ||
| 192 | + | ||
| 193 | + otool -L $(which sherpa-onnx) | ||
| 194 | + otool -l $(which sherpa-onnx) | ||
| 195 | + | ||
| 196 | + echo "---" | ||
| 197 | + | ||
| 198 | + sherpa-onnx-offline --help | ||
| 199 | + | ||
| 200 | + echo "---" | ||
| 201 | + | ||
| 202 | + sherpa-onnx-vad --help | ||
| 203 | + | ||
| 204 | + - name: Publish to huggingface | ||
| 205 | + env: | ||
| 206 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 207 | + uses: nick-fields/retry@v3 | ||
| 208 | + with: | ||
| 209 | + max_attempts: 20 | ||
| 210 | + timeout_seconds: 200 | ||
| 211 | + shell: bash | ||
| 212 | + command: | | ||
| 213 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 214 | + git config --global user.name "Fangjun Kuang" | ||
| 215 | + | ||
| 216 | + rm -rf huggingface | ||
| 217 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 218 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 219 | + | ||
| 220 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 221 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 222 | + | ||
| 223 | + d=cpu/$SHERPA_ONNX_VERSION | ||
| 224 | + | ||
| 225 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface | ||
| 226 | + cd huggingface | ||
| 227 | + git fetch | ||
| 228 | + git pull | ||
| 229 | + git merge -m "merge remote" --ff origin main | ||
| 230 | + | ||
| 231 | + mkdir -p $d | ||
| 232 | + | ||
| 233 | + cp -v /tmp/wheels/*.whl $d/ | ||
| 234 | + | ||
| 235 | + git status | ||
| 236 | + git add . | ||
| 237 | + git commit -m "add more wheels" | ||
| 238 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | ||
| 239 | + | ||
| 240 | + - name: Publish wheels to PyPI ${{ github.event.inputs.publish_sherpa_onnx_bin }} | ||
| 241 | + if: ${{ (github.event.inputs.publish_sherpa_onnx_bin || 'true') == 'true' }} | ||
| 242 | + env: | ||
| 243 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| 244 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| 245 | + shell: bash | ||
| 246 | + run: | | ||
| 247 | + opts='--break-system-packages' | ||
| 248 | + | ||
| 249 | + python3 -m pip install $opts --upgrade pip | ||
| 250 | + python3 -m pip install $opts wheel twine==5.0.0 setuptools | ||
| 251 | + | ||
| 252 | + twine upload /tmp/wheels/*.whl | ||
| 253 | + | ||
| 17 | build_wheels_macos_arm64: | 254 | build_wheels_macos_arm64: |
| 255 | + needs: [core, test] | ||
| 18 | name: ${{ matrix.python-version }} | 256 | name: ${{ matrix.python-version }} |
| 19 | runs-on: ${{ matrix.os }} | 257 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 258 | strategy: |
| 21 | fail-fast: false | 259 | fail-fast: false |
| 22 | matrix: | 260 | matrix: |
| 23 | - os: [macos-13] | ||
| 24 | - python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | 261 | + os: [macos-latest] |
| 262 | + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] | ||
| 25 | 263 | ||
| 26 | steps: | 264 | steps: |
| 27 | - uses: actions/checkout@v4 | 265 | - uses: actions/checkout@v4 |
| @@ -33,10 +271,12 @@ jobs: | @@ -33,10 +271,12 @@ jobs: | ||
| 33 | git diff . | 271 | git diff . |
| 34 | 272 | ||
| 35 | - name: Build wheels | 273 | - name: Build wheels |
| 36 | - uses: pypa/cibuildwheel@v2.21.3 | 274 | + uses: pypa/cibuildwheel@v3.1.4 |
| 37 | env: | 275 | env: |
| 38 | CIBW_BUILD: "${{ matrix.python-version}}-* " | 276 | CIBW_BUILD: "${{ matrix.python-version}}-* " |
| 39 | - CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64'" | 277 | + CIBW_ENVIRONMENT: > |
| 278 | + SHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON | ||
| 279 | + SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64' -DSHERPA_ONNX_ENABLE_BINARY=OFF -DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" | ||
| 40 | CIBW_ARCHS: "arm64" | 280 | CIBW_ARCHS: "arm64" |
| 41 | CIBW_BUILD_VERBOSITY: 3 | 281 | CIBW_BUILD_VERBOSITY: 3 |
| 42 | 282 | ||
| @@ -47,6 +287,7 @@ jobs: | @@ -47,6 +287,7 @@ jobs: | ||
| 47 | shell: bash | 287 | shell: bash |
| 48 | run: | | 288 | run: | |
| 49 | ls -lh ./wheelhouse/ | 289 | ls -lh ./wheelhouse/ |
| 290 | + unzip -l ./wheelhouse/*.whl | ||
| 50 | 291 | ||
| 51 | - uses: actions/upload-artifact@v4 | 292 | - uses: actions/upload-artifact@v4 |
| 52 | with: | 293 | with: |
| @@ -95,10 +336,6 @@ jobs: | @@ -95,10 +336,6 @@ jobs: | ||
| 95 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | 336 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 96 | run: | | 337 | run: | |
| 97 | opts='--break-system-packages' | 338 | opts='--break-system-packages' |
| 98 | - v=${{ matrix.python-version }} | ||
| 99 | - if [[ $v == cp38 || $v == cp39 ]]; then | ||
| 100 | - opts='' | ||
| 101 | - fi | ||
| 102 | 339 | ||
| 103 | python3 -m pip install $opts --upgrade pip | 340 | python3 -m pip install $opts --upgrade pip |
| 104 | python3 -m pip install $opts wheel twine==5.0.0 setuptools | 341 | python3 -m pip install $opts wheel twine==5.0.0 setuptools |
| @@ -5,6 +5,12 @@ on: | @@ -5,6 +5,12 @@ on: | ||
| 5 | branches: | 5 | branches: |
| 6 | - wheel | 6 | - wheel |
| 7 | workflow_dispatch: | 7 | workflow_dispatch: |
| 8 | + inputs: | ||
| 9 | + publish_sherpa_onnx_bin: | ||
| 10 | + description: "Publish sherpa-onnx-bin" | ||
| 11 | + required: false | ||
| 12 | + default: "true" | ||
| 13 | + type: boolean | ||
| 8 | 14 | ||
| 9 | env: | 15 | env: |
| 10 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 | 16 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 |
| @@ -14,14 +20,247 @@ concurrency: | @@ -14,14 +20,247 @@ concurrency: | ||
| 14 | cancel-in-progress: true | 20 | cancel-in-progress: true |
| 15 | 21 | ||
| 16 | jobs: | 22 | jobs: |
| 23 | + core: | ||
| 24 | + runs-on: ${{ matrix.os }} | ||
| 25 | + name: core | ||
| 26 | + strategy: | ||
| 27 | + fail-fast: false | ||
| 28 | + matrix: | ||
| 29 | + os: [macos-latest] | ||
| 30 | + | ||
| 31 | + steps: | ||
| 32 | + - uses: actions/checkout@v4 | ||
| 33 | + with: | ||
| 34 | + fetch-depth: 0 | ||
| 35 | + | ||
| 36 | + - name: Update version | ||
| 37 | + shell: bash | ||
| 38 | + run: | | ||
| 39 | + ./new-release.sh | ||
| 40 | + git diff . | ||
| 41 | + - name: Set up Python | ||
| 42 | + uses: actions/setup-python@v5 | ||
| 43 | + with: | ||
| 44 | + python-version: "3.10" | ||
| 45 | + | ||
| 46 | + - name: Install deps | ||
| 47 | + shell: bash | ||
| 48 | + run: | | ||
| 49 | + python3 -m pip install setuptools wheel twine | ||
| 50 | + | ||
| 51 | + - name: ccache | ||
| 52 | + uses: hendrikmuhs/ccache-action@v1.2 | ||
| 53 | + with: | ||
| 54 | + key: macos-latest-sherpa-onnx-core-universal2 | ||
| 55 | + | ||
| 56 | + - name: Configure CMake | ||
| 57 | + shell: bash | ||
| 58 | + run: | | ||
| 59 | + export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
| 60 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| 61 | + cmake --version | ||
| 62 | + | ||
| 63 | + mkdir build | ||
| 64 | + cd build | ||
| 65 | + | ||
| 66 | + cmake \ | ||
| 67 | + -DSHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON \ | ||
| 68 | + -D BUILD_SHARED_LIBS=ON \ | ||
| 69 | + -D SHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \ | ||
| 70 | + -D CMAKE_BUILD_TYPE=Release \ | ||
| 71 | + -D CMAKE_OSX_ARCHITECTURES='arm64;x86_64' \ | ||
| 72 | + -D CMAKE_INSTALL_PREFIX=./install \ | ||
| 73 | + .. | ||
| 74 | + | ||
| 75 | + - name: Build sherpa-onnx for macos | ||
| 76 | + shell: bash | ||
| 77 | + run: | | ||
| 78 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| 79 | + | ||
| 80 | + cd build | ||
| 81 | + make -j2 | ||
| 82 | + make install | ||
| 83 | + | ||
| 84 | + ls -lh lib | ||
| 85 | + ls -lh bin | ||
| 86 | + | ||
| 87 | + file ./bin/sherpa-onnx | ||
| 88 | + | ||
| 89 | + rm -fv ./install/include/cargs.h | ||
| 90 | + rm -fv ./install/lib/cargs.h | ||
| 91 | + rm -fv ./install/lib/libcargs.dylib | ||
| 92 | + rm -fv ./install/lib/libcargs.a | ||
| 93 | + rm -rfv ./install/lib/pkgconfig | ||
| 94 | + | ||
| 95 | + - name: Copy files | ||
| 96 | + shell: bash | ||
| 97 | + run: | | ||
| 98 | + echo 'sherpa-onnx-core' | ||
| 99 | + mkdir -p scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 100 | + cp -v ./build/install/lib/lib* ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 101 | + | ||
| 102 | + mkdir -p ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 103 | + cp -v ./build/install/include/sherpa-onnx/c-api/*.h ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 104 | + | ||
| 105 | + echo 'sherpa-onnx-bin' | ||
| 106 | + | ||
| 107 | + mkdir -p ./scripts/wheel/sherpa-onnx-bin/bin | ||
| 108 | + cp -v ./build/install/bin/sherpa-onnx* ./scripts/wheel/sherpa-onnx-bin/bin | ||
| 109 | + | ||
| 110 | + - name: Build sherpa-onnx-core | ||
| 111 | + shell: bash | ||
| 112 | + run: | | ||
| 113 | + pushd ./scripts/wheel/sherpa-onnx-core | ||
| 114 | + python3 setup.py bdist_wheel --plat-name=macosx_10_15_universal2 | ||
| 115 | + | ||
| 116 | + ls -lh dist | ||
| 117 | + unzip -l dist/*.whl | ||
| 118 | + | ||
| 119 | + popd | ||
| 120 | + | ||
| 121 | + - name: Build sherpa-onnx-bin | ||
| 122 | + shell: bash | ||
| 123 | + run: | | ||
| 124 | + pushd ./scripts/wheel/sherpa-onnx-bin | ||
| 125 | + python3 setup.py bdist_wheel --plat-name=macosx_10_15_universal2 | ||
| 126 | + | ||
| 127 | + ls -lh dist | ||
| 128 | + unzip -l dist/*.whl | ||
| 129 | + | ||
| 130 | + popd | ||
| 131 | + | ||
| 132 | + - name: Collect wheels | ||
| 133 | + shell: bash | ||
| 134 | + run: | | ||
| 135 | + cp -v ./scripts/wheel/sherpa-onnx-core/dist/*.whl . | ||
| 136 | + cp -v ./scripts/wheel/sherpa-onnx-bin/dist/*.whl . | ||
| 137 | + | ||
| 138 | + ls -lh *.whl | ||
| 139 | + | ||
| 140 | + - uses: actions/upload-artifact@v4 | ||
| 141 | + with: | ||
| 142 | + name: wheels-core-macos-universal | ||
| 143 | + path: ./*.whl | ||
| 144 | + | ||
| 145 | + test: | ||
| 146 | + name: test ${{ matrix.os }} | ||
| 147 | + needs: [core] | ||
| 148 | + runs-on: ${{ matrix.os }} | ||
| 149 | + strategy: | ||
| 150 | + fail-fast: false | ||
| 151 | + matrix: | ||
| 152 | + os: [macos-latest, macos-13] | ||
| 153 | + | ||
| 154 | + steps: | ||
| 155 | + - uses: actions/checkout@v4 | ||
| 156 | + with: | ||
| 157 | + fetch-depth: 0 | ||
| 158 | + | ||
| 159 | + - name: Retrieve artifact from macos universal | ||
| 160 | + uses: actions/download-artifact@v4 | ||
| 161 | + with: | ||
| 162 | + name: wheels-core-macos-universal | ||
| 163 | + path: /tmp/wheels | ||
| 164 | + | ||
| 165 | + - name: Setup Python | ||
| 166 | + uses: actions/setup-python@v5 | ||
| 167 | + with: | ||
| 168 | + python-version: "3.10" | ||
| 169 | + | ||
| 170 | + - name: Show | ||
| 171 | + shell: bash | ||
| 172 | + run: | | ||
| 173 | + ls -lh /tmp/wheels | ||
| 174 | + | ||
| 175 | + - name: Install | ||
| 176 | + shell: bash | ||
| 177 | + run: | | ||
| 178 | + python3 -m pip install /tmp/wheels/*.whl | ||
| 179 | + | ||
| 180 | + - name: Show version | ||
| 181 | + shell: bash | ||
| 182 | + run: | | ||
| 183 | + sherpa-onnx-version | ||
| 184 | + | ||
| 185 | + - name: Show help | ||
| 186 | + shell: bash | ||
| 187 | + run: | | ||
| 188 | + sherpa-onnx --help | ||
| 189 | + | ||
| 190 | + ls -lh $(which sherpa-onnx) | ||
| 191 | + file $(which sherpa-onnx) | ||
| 192 | + | ||
| 193 | + otool -L $(which sherpa-onnx) | ||
| 194 | + otool -l $(which sherpa-onnx) | ||
| 195 | + | ||
| 196 | + echo "---" | ||
| 197 | + | ||
| 198 | + sherpa-onnx-offline --help | ||
| 199 | + | ||
| 200 | + echo "---" | ||
| 201 | + | ||
| 202 | + sherpa-onnx-vad --help | ||
| 203 | + | ||
| 204 | + - name: Publish to huggingface | ||
| 205 | + if: matrix.os == 'macos-latest' | ||
| 206 | + env: | ||
| 207 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 208 | + uses: nick-fields/retry@v3 | ||
| 209 | + with: | ||
| 210 | + max_attempts: 20 | ||
| 211 | + timeout_seconds: 200 | ||
| 212 | + shell: bash | ||
| 213 | + command: | | ||
| 214 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 215 | + git config --global user.name "Fangjun Kuang" | ||
| 216 | + | ||
| 217 | + rm -rf huggingface | ||
| 218 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 219 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 220 | + | ||
| 221 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 222 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 223 | + | ||
| 224 | + d=cpu/$SHERPA_ONNX_VERSION | ||
| 225 | + | ||
| 226 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface | ||
| 227 | + cd huggingface | ||
| 228 | + git fetch | ||
| 229 | + git pull | ||
| 230 | + git merge -m "merge remote" --ff origin main | ||
| 231 | + | ||
| 232 | + mkdir -p $d | ||
| 233 | + | ||
| 234 | + cp -v /tmp/wheels/*.whl $d/ | ||
| 235 | + | ||
| 236 | + git status | ||
| 237 | + git add . | ||
| 238 | + git commit -m "add more wheels" | ||
| 239 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | ||
| 240 | + | ||
| 241 | + - name: Publish wheels to PyPI ${{ github.event.inputs.publish_sherpa_onnx_bin }} | ||
| 242 | + if: ${{ matrix.os == 'macos-latest' && (github.event.inputs.publish_sherpa_onnx_bin || 'true') == 'true' }} | ||
| 243 | + env: | ||
| 244 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| 245 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| 246 | + shell: bash | ||
| 247 | + run: | | ||
| 248 | + opts='--break-system-packages' | ||
| 249 | + | ||
| 250 | + python3 -m pip install $opts --upgrade pip | ||
| 251 | + python3 -m pip install $opts wheel twine==5.0.0 setuptools | ||
| 252 | + | ||
| 253 | + twine upload /tmp/wheels/*.whl | ||
| 254 | + | ||
| 17 | build_wheels_macos_universal2: | 255 | build_wheels_macos_universal2: |
| 256 | + needs: [core, test] | ||
| 18 | name: ${{ matrix.python-version }} | 257 | name: ${{ matrix.python-version }} |
| 19 | runs-on: ${{ matrix.os }} | 258 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 259 | strategy: |
| 21 | fail-fast: false | 260 | fail-fast: false |
| 22 | matrix: | 261 | matrix: |
| 23 | - os: [macos-13] | ||
| 24 | - python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | 262 | + os: [macos-latest] |
| 263 | + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] | ||
| 25 | 264 | ||
| 26 | steps: | 265 | steps: |
| 27 | - uses: actions/checkout@v4 | 266 | - uses: actions/checkout@v4 |
| @@ -32,11 +271,17 @@ jobs: | @@ -32,11 +271,17 @@ jobs: | ||
| 32 | ./new-release.sh | 271 | ./new-release.sh |
| 33 | git diff . | 272 | git diff . |
| 34 | 273 | ||
| 274 | + - name: Set macOS deployment target | ||
| 275 | + run: echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV | ||
| 276 | + | ||
| 35 | - name: Build wheels | 277 | - name: Build wheels |
| 36 | - uses: pypa/cibuildwheel@v2.21.3 | 278 | + uses: pypa/cibuildwheel@v3.1.4 |
| 37 | env: | 279 | env: |
| 38 | CIBW_BUILD: "${{ matrix.python-version}}-* " | 280 | CIBW_BUILD: "${{ matrix.python-version}}-* " |
| 39 | - CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64'" | 281 | + CIBW_ENVIRONMENT: > |
| 282 | + MACOSX_DEPLOYMENT_TARGET=10.15 | ||
| 283 | + SHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON | ||
| 284 | + SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DSHERPA_ONNX_ENABLE_BINARY=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET='10.15' -DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" | ||
| 40 | CIBW_ARCHS: "universal2" | 285 | CIBW_ARCHS: "universal2" |
| 41 | CIBW_BUILD_VERBOSITY: 3 | 286 | CIBW_BUILD_VERBOSITY: 3 |
| 42 | 287 | ||
| @@ -47,6 +292,7 @@ jobs: | @@ -47,6 +292,7 @@ jobs: | ||
| 47 | shell: bash | 292 | shell: bash |
| 48 | run: | | 293 | run: | |
| 49 | ls -lh ./wheelhouse/ | 294 | ls -lh ./wheelhouse/ |
| 295 | + unzip -l ./wheelhouse/*.whl | ||
| 50 | 296 | ||
| 51 | - uses: actions/upload-artifact@v4 | 297 | - uses: actions/upload-artifact@v4 |
| 52 | with: | 298 | with: |
| @@ -95,10 +341,6 @@ jobs: | @@ -95,10 +341,6 @@ jobs: | ||
| 95 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | 341 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 96 | run: | | 342 | run: | |
| 97 | opts='--break-system-packages' | 343 | opts='--break-system-packages' |
| 98 | - v=${{ matrix.python-version }} | ||
| 99 | - if [[ $v == cp38 || $v == cp39 ]]; then | ||
| 100 | - opts='' | ||
| 101 | - fi | ||
| 102 | 344 | ||
| 103 | python3 -m pip install $opts --upgrade pip | 345 | python3 -m pip install $opts --upgrade pip |
| 104 | python3 -m pip install $opts wheel twine==5.0.0 setuptools | 346 | python3 -m pip install $opts wheel twine==5.0.0 setuptools |
| @@ -5,6 +5,12 @@ on: | @@ -5,6 +5,12 @@ on: | ||
| 5 | branches: | 5 | branches: |
| 6 | - wheel | 6 | - wheel |
| 7 | workflow_dispatch: | 7 | workflow_dispatch: |
| 8 | + inputs: | ||
| 9 | + publish_sherpa_onnx_bin: | ||
| 10 | + description: "Publish sherpa-onnx-bin" | ||
| 11 | + required: false | ||
| 12 | + default: "true" | ||
| 13 | + type: boolean | ||
| 8 | 14 | ||
| 9 | env: | 15 | env: |
| 10 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 | 16 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 |
| @@ -14,44 +20,266 @@ concurrency: | @@ -14,44 +20,266 @@ concurrency: | ||
| 14 | cancel-in-progress: true | 20 | cancel-in-progress: true |
| 15 | 21 | ||
| 16 | jobs: | 22 | jobs: |
| 17 | - build_wheels_macos_x64: | ||
| 18 | - name: ${{ matrix.python-version }} | 23 | + core: |
| 19 | runs-on: ${{ matrix.os }} | 24 | runs-on: ${{ matrix.os }} |
| 25 | + name: core | ||
| 20 | strategy: | 26 | strategy: |
| 21 | fail-fast: false | 27 | fail-fast: false |
| 22 | matrix: | 28 | matrix: |
| 23 | - os: [macos-13] | ||
| 24 | - python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | 29 | + os: [macos-latest] |
| 25 | 30 | ||
| 26 | steps: | 31 | steps: |
| 27 | - uses: actions/checkout@v4 | 32 | - uses: actions/checkout@v4 |
| 33 | + with: | ||
| 34 | + fetch-depth: 0 | ||
| 28 | 35 | ||
| 29 | - name: Update version | 36 | - name: Update version |
| 30 | shell: bash | 37 | shell: bash |
| 31 | run: | | 38 | run: | |
| 32 | ./new-release.sh | 39 | ./new-release.sh |
| 33 | git diff . | 40 | git diff . |
| 41 | + - name: Set up Python | ||
| 42 | + uses: actions/setup-python@v5 | ||
| 43 | + with: | ||
| 44 | + python-version: "3.10" | ||
| 34 | 45 | ||
| 35 | - # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ | ||
| 36 | - # for a list of versions | ||
| 37 | - - name: Build wheels | ||
| 38 | - if: matrix.python-version == 'cp37' | ||
| 39 | - uses: pypa/cibuildwheel@v2.11.4 | 46 | + - name: Install deps |
| 47 | + shell: bash | ||
| 48 | + run: | | ||
| 49 | + python3 -m pip install setuptools wheel twine | ||
| 50 | + | ||
| 51 | + - name: ccache | ||
| 52 | + uses: hendrikmuhs/ccache-action@v1.2 | ||
| 53 | + with: | ||
| 54 | + key: macos-latest-sherpa-onnx-core-x64 | ||
| 55 | + | ||
| 56 | + - name: Configure CMake | ||
| 57 | + shell: bash | ||
| 58 | + run: | | ||
| 59 | + export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
| 60 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| 61 | + cmake --version | ||
| 62 | + | ||
| 63 | + mkdir build | ||
| 64 | + cd build | ||
| 65 | + | ||
| 66 | + cmake \ | ||
| 67 | + -DSHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON \ | ||
| 68 | + -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 \ | ||
| 69 | + -D BUILD_SHARED_LIBS=ON \ | ||
| 70 | + -D SHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \ | ||
| 71 | + -D CMAKE_BUILD_TYPE=Release \ | ||
| 72 | + -D CMAKE_OSX_ARCHITECTURES='x86_64' \ | ||
| 73 | + -D CMAKE_INSTALL_PREFIX=./install \ | ||
| 74 | + .. | ||
| 75 | + | ||
| 76 | + - name: Build sherpa-onnx for macos | ||
| 77 | + shell: bash | ||
| 78 | + run: | | ||
| 79 | + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
| 80 | + | ||
| 81 | + cd build | ||
| 82 | + make -j2 | ||
| 83 | + make install | ||
| 84 | + | ||
| 85 | + ls -lh lib | ||
| 86 | + ls -lh bin | ||
| 87 | + | ||
| 88 | + file ./bin/sherpa-onnx | ||
| 89 | + | ||
| 90 | + rm -fv ./install/include/cargs.h | ||
| 91 | + rm -fv ./install/lib/cargs.h | ||
| 92 | + rm -fv ./install/lib/libcargs.dylib | ||
| 93 | + rm -fv ./install/lib/libcargs.a | ||
| 94 | + rm -rfv ./install/lib/pkgconfig | ||
| 95 | + | ||
| 96 | + - name: Copy files | ||
| 97 | + shell: bash | ||
| 98 | + run: | | ||
| 99 | + echo 'sherpa-onnx-core' | ||
| 100 | + mkdir -p scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 101 | + cp -v ./build/install/lib/lib* ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 102 | + | ||
| 103 | + mkdir -p ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 104 | + cp -v ./build/install/include/sherpa-onnx/c-api/*.h ./scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 105 | + | ||
| 106 | + echo 'sherpa-onnx-bin' | ||
| 107 | + | ||
| 108 | + mkdir -p ./scripts/wheel/sherpa-onnx-bin/bin | ||
| 109 | + cp -v ./build/install/bin/sherpa-onnx* ./scripts/wheel/sherpa-onnx-bin/bin | ||
| 110 | + | ||
| 111 | + - name: Build sherpa-onnx-core | ||
| 112 | + shell: bash | ||
| 113 | + run: | | ||
| 114 | + pushd ./scripts/wheel/sherpa-onnx-core | ||
| 115 | + python3 setup.py bdist_wheel --plat-name=macosx_10_15_x86_64 | ||
| 116 | + | ||
| 117 | + ls -lh dist | ||
| 118 | + unzip -l dist/*.whl | ||
| 119 | + | ||
| 120 | + popd | ||
| 121 | + | ||
| 122 | + - name: Build sherpa-onnx-bin | ||
| 123 | + shell: bash | ||
| 124 | + run: | | ||
| 125 | + pushd ./scripts/wheel/sherpa-onnx-bin | ||
| 126 | + python3 setup.py bdist_wheel --plat-name=macosx_10_15_x86_64 | ||
| 127 | + | ||
| 128 | + ls -lh dist | ||
| 129 | + unzip -l dist/*.whl | ||
| 130 | + | ||
| 131 | + popd | ||
| 132 | + | ||
| 133 | + - name: Collect wheels | ||
| 134 | + shell: bash | ||
| 135 | + run: | | ||
| 136 | + cp -v ./scripts/wheel/sherpa-onnx-core/dist/*.whl . | ||
| 137 | + cp -v ./scripts/wheel/sherpa-onnx-bin/dist/*.whl . | ||
| 138 | + | ||
| 139 | + ls -lh *.whl | ||
| 140 | + | ||
| 141 | + - uses: actions/upload-artifact@v4 | ||
| 142 | + with: | ||
| 143 | + name: wheels-core-macos-x64 | ||
| 144 | + path: ./*.whl | ||
| 145 | + | ||
| 146 | + test: | ||
| 147 | + name: test | ||
| 148 | + needs: [core] | ||
| 149 | + runs-on: ${{ matrix.os }} | ||
| 150 | + strategy: | ||
| 151 | + fail-fast: false | ||
| 152 | + matrix: | ||
| 153 | + os: [macos-13] | ||
| 154 | + | ||
| 155 | + steps: | ||
| 156 | + - uses: actions/checkout@v4 | ||
| 157 | + with: | ||
| 158 | + fetch-depth: 0 | ||
| 159 | + | ||
| 160 | + - name: Retrieve artifact from macos x64 | ||
| 161 | + uses: actions/download-artifact@v4 | ||
| 162 | + with: | ||
| 163 | + name: wheels-core-macos-x64 | ||
| 164 | + path: /tmp/wheels | ||
| 165 | + | ||
| 166 | + - name: Setup Python | ||
| 167 | + uses: actions/setup-python@v5 | ||
| 168 | + with: | ||
| 169 | + python-version: "3.10" | ||
| 170 | + | ||
| 171 | + - name: Show | ||
| 172 | + shell: bash | ||
| 173 | + run: | | ||
| 174 | + ls -lh /tmp/wheels | ||
| 175 | + | ||
| 176 | + - name: Install | ||
| 177 | + shell: bash | ||
| 178 | + run: | | ||
| 179 | + python3 -m pip install /tmp/wheels/*.whl | ||
| 180 | + | ||
| 181 | + - name: Show version | ||
| 182 | + shell: bash | ||
| 183 | + run: | | ||
| 184 | + sherpa-onnx-version | ||
| 185 | + | ||
| 186 | + - name: Show help | ||
| 187 | + shell: bash | ||
| 188 | + run: | | ||
| 189 | + sherpa-onnx --help | ||
| 190 | + | ||
| 191 | + ls -lh $(which sherpa-onnx) | ||
| 192 | + file $(which sherpa-onnx) | ||
| 193 | + otool -L $(which sherpa-onnx) | ||
| 194 | + otool -l $(which sherpa-onnx) | ||
| 195 | + | ||
| 196 | + echo "---" | ||
| 197 | + | ||
| 198 | + sherpa-onnx-offline --help | ||
| 199 | + | ||
| 200 | + echo "---" | ||
| 201 | + | ||
| 202 | + sherpa-onnx-vad --help | ||
| 203 | + | ||
| 204 | + - name: Publish to huggingface | ||
| 40 | env: | 205 | env: |
| 41 | - CIBW_BUILD: "${{ matrix.python-version}}-* " | ||
| 42 | - CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='x86_64'" | ||
| 43 | - CIBW_ARCHS: "x86_64" | ||
| 44 | - CIBW_BUILD_VERBOSITY: 3 | 206 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 207 | + uses: nick-fields/retry@v3 | ||
| 208 | + with: | ||
| 209 | + max_attempts: 20 | ||
| 210 | + timeout_seconds: 200 | ||
| 211 | + shell: bash | ||
| 212 | + command: | | ||
| 213 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 214 | + git config --global user.name "Fangjun Kuang" | ||
| 45 | 215 | ||
| 46 | - # Don't repair macOS wheels | ||
| 47 | - CIBW_REPAIR_WHEEL_COMMAND_MACOS: "" | 216 | + rm -rf huggingface |
| 217 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 218 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 219 | + | ||
| 220 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 221 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 222 | + | ||
| 223 | + d=cpu/$SHERPA_ONNX_VERSION | ||
| 224 | + | ||
| 225 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface | ||
| 226 | + cd huggingface | ||
| 227 | + git fetch | ||
| 228 | + git pull | ||
| 229 | + git merge -m "merge remote" --ff origin main | ||
| 230 | + | ||
| 231 | + mkdir -p $d | ||
| 232 | + | ||
| 233 | + cp -v /tmp/wheels/*.whl $d/ | ||
| 234 | + | ||
| 235 | + git status | ||
| 236 | + git add . | ||
| 237 | + git commit -m "add more wheels" | ||
| 238 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | ||
| 239 | + | ||
| 240 | + - name: Publish wheels to PyPI ${{ github.event.inputs.publish_sherpa_onnx_bin }} | ||
| 241 | + if: ${{ (github.event.inputs.publish_sherpa_onnx_bin || 'true') == 'true' }} | ||
| 242 | + env: | ||
| 243 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| 244 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| 245 | + shell: bash | ||
| 246 | + run: | | ||
| 247 | + python3 -m pip install --upgrade pip | ||
| 248 | + python3 -m pip install wheel twine==5.0.0 setuptools | ||
| 249 | + | ||
| 250 | + twine upload /tmp/wheels/*.whl | ||
| 251 | + | ||
| 252 | + build_wheels_macos_x64: | ||
| 253 | + needs: [core, test] | ||
| 254 | + name: ${{ matrix.python-version }} | ||
| 255 | + runs-on: ${{ matrix.os }} | ||
| 256 | + strategy: | ||
| 257 | + fail-fast: false | ||
| 258 | + matrix: | ||
| 259 | + os: [macos-latest] | ||
| 260 | + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] | ||
| 261 | + | ||
| 262 | + steps: | ||
| 263 | + - uses: actions/checkout@v4 | ||
| 264 | + | ||
| 265 | + - name: Update version | ||
| 266 | + shell: bash | ||
| 267 | + run: | | ||
| 268 | + ./new-release.sh | ||
| 269 | + git diff . | ||
| 270 | + | ||
| 271 | + - name: Set macOS deployment target | ||
| 272 | + run: echo "MACOSX_DEPLOYMENT_TARGET=10.15" >> $GITHUB_ENV | ||
| 48 | 273 | ||
| 49 | - name: Build wheels | 274 | - name: Build wheels |
| 50 | - if: matrix.python-version != 'cp37' | ||
| 51 | - uses: pypa/cibuildwheel@v2.21.3 | 275 | + uses: pypa/cibuildwheel@v3.1.4 |
| 52 | env: | 276 | env: |
| 53 | CIBW_BUILD: "${{ matrix.python-version}}-* " | 277 | CIBW_BUILD: "${{ matrix.python-version}}-* " |
| 54 | - CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='x86_64'" | 278 | + CIBW_ENVIRONMENT: > |
| 279 | + MACOSX_DEPLOYMENT_TARGET=10.15 | ||
| 280 | + SHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON | ||
| 281 | + SHERPA_ONNX_CMAKE_ARGS="-DCMAKE_OSX_ARCHITECTURES='x86_64' -DSHERPA_ONNX_ENABLE_BINARY=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET='10.15' -DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" | ||
| 282 | + | ||
| 55 | CIBW_ARCHS: "x86_64" | 283 | CIBW_ARCHS: "x86_64" |
| 56 | CIBW_BUILD_VERBOSITY: 3 | 284 | CIBW_BUILD_VERBOSITY: 3 |
| 57 | 285 | ||
| @@ -62,10 +290,11 @@ jobs: | @@ -62,10 +290,11 @@ jobs: | ||
| 62 | shell: bash | 290 | shell: bash |
| 63 | run: | | 291 | run: | |
| 64 | ls -lh ./wheelhouse/ | 292 | ls -lh ./wheelhouse/ |
| 293 | + unzip -l ./wheelhouse/*.whl | ||
| 65 | 294 | ||
| 66 | - uses: actions/upload-artifact@v4 | 295 | - uses: actions/upload-artifact@v4 |
| 67 | with: | 296 | with: |
| 68 | - name: wheel-${{ matrix.python-version }} | 297 | + name: wheel-macos-x64-${{ matrix.python-version }} |
| 69 | path: ./wheelhouse/*.whl | 298 | path: ./wheelhouse/*.whl |
| 70 | 299 | ||
| 71 | - name: Publish to huggingface | 300 | - name: Publish to huggingface |
| @@ -110,16 +339,8 @@ jobs: | @@ -110,16 +339,8 @@ jobs: | ||
| 110 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | 339 | TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |
| 111 | run: | | 340 | run: | |
| 112 | opts='--break-system-packages' | 341 | opts='--break-system-packages' |
| 113 | - v=${{ matrix.python-version }} | ||
| 114 | - if [[ $v == cp37 || $v == cp38 || $v == cp39 ]]; then | ||
| 115 | - opts='' | ||
| 116 | - fi | ||
| 117 | 342 | ||
| 118 | python3 -m pip install $opts --upgrade pip | 343 | python3 -m pip install $opts --upgrade pip |
| 119 | - if [[ ${{ matrix.python-version }} == "cp37" ]]; then | ||
| 120 | - python3 -m pip install $opts wheel twine setuptools | ||
| 121 | - else | ||
| 122 | - python3 -m pip install $opts wheel twine==5.0.0 setuptools | ||
| 123 | - fi | 344 | + python3 -m pip install $opts wheel twine==5.0.0 setuptools |
| 124 | 345 | ||
| 125 | twine upload ./wheelhouse/*.whl | 346 | twine upload ./wheelhouse/*.whl |
| @@ -5,6 +5,12 @@ on: | @@ -5,6 +5,12 @@ on: | ||
| 5 | branches: | 5 | branches: |
| 6 | - wheel | 6 | - wheel |
| 7 | workflow_dispatch: | 7 | workflow_dispatch: |
| 8 | + inputs: | ||
| 9 | + publish_sherpa_onnx_bin: | ||
| 10 | + description: "Publish sherpa-onnx-bin" | ||
| 11 | + required: false | ||
| 12 | + default: "true" | ||
| 13 | + type: boolean | ||
| 8 | 14 | ||
| 9 | env: | 15 | env: |
| 10 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 | 16 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 |
| @@ -14,14 +20,251 @@ concurrency: | @@ -14,14 +20,251 @@ concurrency: | ||
| 14 | cancel-in-progress: true | 20 | cancel-in-progress: true |
| 15 | 21 | ||
| 16 | jobs: | 22 | jobs: |
| 23 | + core: | ||
| 24 | + name: core | ||
| 25 | + runs-on: ${{ matrix.os }} | ||
| 26 | + strategy: | ||
| 27 | + fail-fast: false | ||
| 28 | + matrix: | ||
| 29 | + os: [windows-latest] | ||
| 30 | + | ||
| 31 | + steps: | ||
| 32 | + - uses: actions/checkout@v4 | ||
| 33 | + with: | ||
| 34 | + fetch-depth: 0 | ||
| 35 | + | ||
| 36 | + - name: Update version | ||
| 37 | + shell: bash | ||
| 38 | + run: | | ||
| 39 | + ./new-release.sh | ||
| 40 | + git diff . | ||
| 41 | + | ||
| 42 | + - name: Setup Python | ||
| 43 | + uses: actions/setup-python@v5 | ||
| 44 | + with: | ||
| 45 | + python-version: "3.10" | ||
| 46 | + | ||
| 47 | + - name: Install Python dependencies | ||
| 48 | + shell: bash | ||
| 49 | + run: | | ||
| 50 | + python3 -m pip install wheel twine==5.0.0 setuptools | ||
| 51 | + | ||
| 52 | + - name: Install sccache | ||
| 53 | + run: choco install sccache -y | ||
| 54 | + | ||
| 55 | + - name: Cache sccache | ||
| 56 | + uses: actions/cache@v3 | ||
| 57 | + with: | ||
| 58 | + path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache | ||
| 59 | + key: ${{ matrix.os }}-sccache-core-win32 | ||
| 60 | + restore-keys: | | ||
| 61 | + ${{ matrix.os }}-sccache-core-win32 | ||
| 62 | + | ||
| 63 | + - name: Configure CMake | ||
| 64 | + shell: bash | ||
| 65 | + run: | | ||
| 66 | + mkdir build | ||
| 67 | + cd build | ||
| 68 | + cmake \ | ||
| 69 | + -D CMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
| 70 | + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache \ | ||
| 71 | + -A Win32 \ | ||
| 72 | + -D CMAKE_BUILD_TYPE=Release \ | ||
| 73 | + -D BUILD_SHARED_LIBS=ON \ | ||
| 74 | + -D SHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \ | ||
| 75 | + -DCMAKE_INSTALL_PREFIX=./install \ | ||
| 76 | + .. | ||
| 77 | + | ||
| 78 | + - name: Build sherpa-onnx for windows | ||
| 79 | + shell: bash | ||
| 80 | + run: | | ||
| 81 | + cd build | ||
| 82 | + cmake --build . --config Release -- -m:2 | ||
| 83 | + cmake --build . --config Release --target install -- -m:2 | ||
| 84 | + | ||
| 85 | + ls -lh ./bin/Release/sherpa-onnx.exe | ||
| 86 | + | ||
| 87 | + - name: Show sccache stats | ||
| 88 | + run: sccache --show-stats | ||
| 89 | + | ||
| 90 | + - name: Show | ||
| 91 | + shell: bash | ||
| 92 | + run: | | ||
| 93 | + echo "---bin---" | ||
| 94 | + ls -lh build/install/bin | ||
| 95 | + echo "---lib---" | ||
| 96 | + ls -lh build/install/lib | ||
| 97 | + echo "---include---" | ||
| 98 | + ls -lh build/install/include | ||
| 99 | + | ||
| 100 | + - name: Copy files | ||
| 101 | + shell: bash | ||
| 102 | + run: | | ||
| 103 | + cd build | ||
| 104 | + echo 'sherpa-onnx-core' | ||
| 105 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 106 | + cp -v ./install/lib/onnxruntime.dll ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 107 | + cp -v ./install/lib/sherpa-onnx-*.dll ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 108 | + # keep the *.lib file so users can write code to link with our dll | ||
| 109 | + cp -v ./install/lib/sherpa-onnx-*.lib ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 110 | + | ||
| 111 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 112 | + cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 113 | + | ||
| 114 | + pushd ../scripts/wheel/sherpa-onnx-core | ||
| 115 | + python3 setup.py bdist_wheel --plat-name=win32 | ||
| 116 | + | ||
| 117 | + ls -lh dist | ||
| 118 | + | ||
| 119 | + popd | ||
| 120 | + | ||
| 121 | + echo 'sherpa-onnx-bin' | ||
| 122 | + | ||
| 123 | + mkdir -p ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 124 | + cp -v ./install/bin/sherpa-onnx* ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 125 | + | ||
| 126 | + pushd ../scripts/wheel/sherpa-onnx-bin | ||
| 127 | + python3 setup.py bdist_wheel --plat-name=win32 | ||
| 128 | + | ||
| 129 | + ls -lh dist | ||
| 130 | + | ||
| 131 | + popd | ||
| 132 | + | ||
| 133 | + - name: Collect wheels | ||
| 134 | + shell: bash | ||
| 135 | + run: | | ||
| 136 | + mkdir wheelhouse | ||
| 137 | + cp -v ./scripts/wheel/sherpa-onnx-core/dist/*.whl ./wheelhouse | ||
| 138 | + cp -v ./scripts/wheel/sherpa-onnx-bin/dist/*.whl ./wheelhouse | ||
| 139 | + | ||
| 140 | + - uses: actions/upload-artifact@v4 | ||
| 141 | + with: | ||
| 142 | + name: wheels-core-win-x86 | ||
| 143 | + path: ./wheelhouse/*.whl | ||
| 144 | + | ||
| 145 | + - name: Show wheels | ||
| 146 | + shell: bash | ||
| 147 | + run: | | ||
| 148 | + ls -lh ./scripts/wheel/sherpa-onnx-core/dist | ||
| 149 | + ls -lh ./scripts/wheel/sherpa-onnx-bin/dist | ||
| 150 | + | ||
| 151 | + unzip -l ./scripts/wheel/sherpa-onnx-core/dist/*.whl | ||
| 152 | + echo "---" | ||
| 153 | + unzip -l ./scripts/wheel/sherpa-onnx-bin/dist/*.whl | ||
| 154 | + | ||
| 155 | + test: | ||
| 156 | + name: test | ||
| 157 | + needs: [core] | ||
| 158 | + runs-on: ${{ matrix.os }} | ||
| 159 | + strategy: | ||
| 160 | + fail-fast: false | ||
| 161 | + matrix: | ||
| 162 | + os: [windows-2022] | ||
| 163 | + | ||
| 164 | + steps: | ||
| 165 | + - uses: actions/checkout@v4 | ||
| 166 | + with: | ||
| 167 | + fetch-depth: 0 | ||
| 168 | + | ||
| 169 | + - name: Retrieve artifact from Windows x86 | ||
| 170 | + uses: actions/download-artifact@v4 | ||
| 171 | + with: | ||
| 172 | + name: wheels-core-win-x86 | ||
| 173 | + path: /tmp/wheels | ||
| 174 | + | ||
| 175 | + - name: Setup Python | ||
| 176 | + uses: actions/setup-python@v5 | ||
| 177 | + with: | ||
| 178 | + python-version: "3.10" | ||
| 179 | + architecture: x86 | ||
| 180 | + | ||
| 181 | + - name: Show | ||
| 182 | + shell: bash | ||
| 183 | + run: | | ||
| 184 | + ls -lh /d/tmp/wheels | ||
| 185 | + | ||
| 186 | + - name: Install | ||
| 187 | + shell: bash | ||
| 188 | + run: | | ||
| 189 | + python3 -m pip install /d/tmp/wheels/*.whl | ||
| 190 | + | ||
| 191 | + - name: Show version | ||
| 192 | + shell: bash | ||
| 193 | + run: | | ||
| 194 | + sherpa-onnx-version | ||
| 195 | + | ||
| 196 | + which sherpa-onnx-version | ||
| 197 | + | ||
| 198 | + - name: Show help | ||
| 199 | + shell: bash | ||
| 200 | + run: | | ||
| 201 | + sherpa-onnx --help | ||
| 202 | + | ||
| 203 | + echo "---" | ||
| 204 | + | ||
| 205 | + sherpa-onnx-offline --help | ||
| 206 | + | ||
| 207 | + echo "---" | ||
| 208 | + | ||
| 209 | + sherpa-onnx-vad --help | ||
| 210 | + | ||
| 211 | + - name: Publish to huggingface | ||
| 212 | + env: | ||
| 213 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 214 | + uses: nick-fields/retry@v3 | ||
| 215 | + with: | ||
| 216 | + max_attempts: 20 | ||
| 217 | + timeout_seconds: 200 | ||
| 218 | + shell: bash | ||
| 219 | + command: | | ||
| 220 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 221 | + git config --global user.name "Fangjun Kuang" | ||
| 222 | + | ||
| 223 | + rm -rf huggingface | ||
| 224 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 225 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 226 | + | ||
| 227 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 228 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 229 | + | ||
| 230 | + d=cpu/$SHERPA_ONNX_VERSION | ||
| 231 | + | ||
| 232 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface | ||
| 233 | + cd huggingface | ||
| 234 | + git fetch | ||
| 235 | + git pull | ||
| 236 | + git merge -m "merge remote" --ff origin main | ||
| 237 | + | ||
| 238 | + mkdir -p $d | ||
| 239 | + | ||
| 240 | + cp -v /d/tmp/wheels/*.whl $d/ | ||
| 241 | + | ||
| 242 | + git status | ||
| 243 | + git add . | ||
| 244 | + git commit -m "add more wheels" | ||
| 245 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | ||
| 246 | + | ||
| 247 | + - name: Publish wheels to PyPI ${{ github.event.inputs.publish_sherpa_onnx_bin }} | ||
| 248 | + if: ${{ (github.event.inputs.publish_sherpa_onnx_bin || 'true') == 'true' }} | ||
| 249 | + env: | ||
| 250 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| 251 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| 252 | + shell: bash | ||
| 253 | + run: | | ||
| 254 | + python3 -m pip install --upgrade pip | ||
| 255 | + python3 -m pip install wheel twine==5.0.0 setuptools | ||
| 256 | + | ||
| 257 | + twine upload /d/tmp/wheels/*.whl | ||
| 258 | + | ||
| 17 | build_wheels_win32: | 259 | build_wheels_win32: |
| 260 | + needs: [core, test] | ||
| 18 | name: ${{ matrix.python-version }} | 261 | name: ${{ matrix.python-version }} |
| 19 | runs-on: ${{ matrix.os }} | 262 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 263 | strategy: |
| 21 | fail-fast: false | 264 | fail-fast: false |
| 22 | matrix: | 265 | matrix: |
| 23 | os: [windows-latest] | 266 | os: [windows-latest] |
| 24 | - python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"] | 267 | + python-version: ["cp38", "cp39", "cp310", "cp311", "cp312", "cp313", "cp314"] |
| 25 | 268 | ||
| 26 | steps: | 269 | steps: |
| 27 | - uses: actions/checkout@v4 | 270 | - uses: actions/checkout@v4 |
| @@ -34,19 +277,23 @@ jobs: | @@ -34,19 +277,23 @@ jobs: | ||
| 34 | 277 | ||
| 35 | # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ | 278 | # see https://cibuildwheel.readthedocs.io/en/stable/changelog/ |
| 36 | # for a list of versions | 279 | # for a list of versions |
| 37 | - - name: Build wheels | ||
| 38 | - uses: pypa/cibuildwheel@v2.21.3 | 280 | + - name: Build wheels (cibuildwheel) |
| 281 | + uses: pypa/cibuildwheel@v3.1.4 | ||
| 39 | env: | 282 | env: |
| 40 | - CIBW_ENVIRONMENT: SHERPA_ONNX_CMAKE_ARGS="-A Win32" | ||
| 41 | CIBW_BUILD: "${{ matrix.python-version}}-* " | 283 | CIBW_BUILD: "${{ matrix.python-version}}-* " |
| 42 | CIBW_SKIP: "*-win_amd64" | 284 | CIBW_SKIP: "*-win_amd64" |
| 43 | CIBW_BUILD_VERBOSITY: 3 | 285 | CIBW_BUILD_VERBOSITY: 3 |
| 286 | + CIBW_ENVIRONMENT: > | ||
| 287 | + SHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON | ||
| 288 | + SHERPA_ONNX_CMAKE_ARGS="-A Win32 -DSHERPA_ONNX_ENABLE_BINARY=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" | ||
| 44 | 289 | ||
| 45 | - name: Display wheels | 290 | - name: Display wheels |
| 46 | shell: bash | 291 | shell: bash |
| 47 | run: | | 292 | run: | |
| 48 | ls -lh ./wheelhouse/ | 293 | ls -lh ./wheelhouse/ |
| 49 | 294 | ||
| 295 | + unzip -l ./wheelhouse/*.whl | ||
| 296 | + | ||
| 50 | - uses: actions/upload-artifact@v4 | 297 | - uses: actions/upload-artifact@v4 |
| 51 | with: | 298 | with: |
| 52 | name: wheel-${{ matrix.python-version }} | 299 | name: wheel-${{ matrix.python-version }} |
| @@ -15,13 +15,14 @@ concurrency: | @@ -15,13 +15,14 @@ concurrency: | ||
| 15 | 15 | ||
| 16 | jobs: | 16 | jobs: |
| 17 | build_wheels_win64_cuda: | 17 | build_wheels_win64_cuda: |
| 18 | - name: ${{ matrix.python-version }} | 18 | + name: ${{ matrix.python-version }} ${{ matrix.onnxruntime_version }} |
| 19 | runs-on: ${{ matrix.os }} | 19 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 20 | strategy: |
| 21 | fail-fast: false | 21 | fail-fast: false |
| 22 | matrix: | 22 | matrix: |
| 23 | os: [windows-2022] | 23 | os: [windows-2022] |
| 24 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | 24 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] |
| 25 | + onnxruntime_version: ["1.17.1", "1.22.0"] | ||
| 25 | 26 | ||
| 26 | steps: | 27 | steps: |
| 27 | - uses: actions/checkout@v4 | 28 | - uses: actions/checkout@v4 |
| @@ -44,6 +45,17 @@ jobs: | @@ -44,6 +45,17 @@ jobs: | ||
| 44 | 45 | ||
| 45 | export SHERPA_ONNX_CMAKE_ARGS="-DSHERPA_ONNX_ENABLE_GPU=ON" | 46 | export SHERPA_ONNX_CMAKE_ARGS="-DSHERPA_ONNX_ENABLE_GPU=ON" |
| 46 | 47 | ||
| 48 | + onnxruntime_version=${{ matrix.onnxruntime_version }} | ||
| 49 | + if [[ $onnxruntime_version == "1.22.0" ]]; then | ||
| 50 | + curl -SL -O https://github.com/microsoft/onnxruntime/releases/download/v1.22.0/onnxruntime-win-x64-gpu-1.22.0.zip | ||
| 51 | + unzip onnxruntime-win-x64-gpu-1.22.0.zip | ||
| 52 | + | ||
| 53 | + export SHERPA_ONNXRUNTIME_LIB_DIR=$PWD/onnxruntime-win-x64-gpu-1.22.0/lib | ||
| 54 | + export SHERPA_ONNXRUNTIME_INCLUDE_DIR=$PWD/onnxruntime-win-x64-gpu-1.22.0/include | ||
| 55 | + | ||
| 56 | + export SHERPA_ONNX_CUDA_VERSION="12.cudnn9" | ||
| 57 | + fi | ||
| 58 | + | ||
| 47 | python3 setup.py bdist_wheel | 59 | python3 setup.py bdist_wheel |
| 48 | 60 | ||
| 49 | ls -lh ./dist/ | 61 | ls -lh ./dist/ |
| @@ -54,10 +66,11 @@ jobs: | @@ -54,10 +66,11 @@ jobs: | ||
| 54 | shell: bash | 66 | shell: bash |
| 55 | run: | | 67 | run: | |
| 56 | ls -lh ./wheelhouse/ | 68 | ls -lh ./wheelhouse/ |
| 69 | + unzip -l ./wheelhouse/*.whl | ||
| 57 | 70 | ||
| 58 | - uses: actions/upload-artifact@v4 | 71 | - uses: actions/upload-artifact@v4 |
| 59 | with: | 72 | with: |
| 60 | - name: wheel-${{ matrix.python-version }} | 73 | + name: wheel-${{ matrix.python-version }}-${{ matrix.onnxruntime_version }} |
| 61 | path: ./wheelhouse/*.whl | 74 | path: ./wheelhouse/*.whl |
| 62 | 75 | ||
| 63 | - name: Publish to huggingface | 76 | - name: Publish to huggingface |
| @@ -5,6 +5,12 @@ on: | @@ -5,6 +5,12 @@ on: | ||
| 5 | branches: | 5 | branches: |
| 6 | - wheel | 6 | - wheel |
| 7 | workflow_dispatch: | 7 | workflow_dispatch: |
| 8 | + inputs: | ||
| 9 | + publish_sherpa_onnx_bin: | ||
| 10 | + description: "Publish sherpa-onnx-bin" | ||
| 11 | + required: false | ||
| 12 | + default: "true" | ||
| 13 | + type: boolean | ||
| 8 | 14 | ||
| 9 | env: | 15 | env: |
| 10 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 | 16 | SHERPA_ONNX_IS_IN_GITHUB_ACTIONS: 1 |
| @@ -14,13 +20,252 @@ concurrency: | @@ -14,13 +20,252 @@ concurrency: | ||
| 14 | cancel-in-progress: true | 20 | cancel-in-progress: true |
| 15 | 21 | ||
| 16 | jobs: | 22 | jobs: |
| 23 | + core: | ||
| 24 | + name: core | ||
| 25 | + runs-on: ${{ matrix.os }} | ||
| 26 | + strategy: | ||
| 27 | + fail-fast: false | ||
| 28 | + matrix: | ||
| 29 | + os: [windows-latest] | ||
| 30 | + | ||
| 31 | + steps: | ||
| 32 | + - uses: actions/checkout@v4 | ||
| 33 | + with: | ||
| 34 | + fetch-depth: 0 | ||
| 35 | + | ||
| 36 | + - name: Update version | ||
| 37 | + shell: bash | ||
| 38 | + run: | | ||
| 39 | + ./new-release.sh | ||
| 40 | + git diff . | ||
| 41 | + | ||
| 42 | + - name: Setup Python | ||
| 43 | + uses: actions/setup-python@v5 | ||
| 44 | + with: | ||
| 45 | + python-version: "3.10" | ||
| 46 | + | ||
| 47 | + - name: Install Python dependencies | ||
| 48 | + shell: bash | ||
| 49 | + run: | | ||
| 50 | + python3 -m pip install wheel twine==5.0.0 setuptools | ||
| 51 | + | ||
| 52 | + - name: Install sccache | ||
| 53 | + run: choco install sccache -y | ||
| 54 | + | ||
| 55 | + - name: Cache sccache | ||
| 56 | + uses: actions/cache@v3 | ||
| 57 | + with: | ||
| 58 | + path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache | ||
| 59 | + key: ${{ matrix.os }}-sccache-core | ||
| 60 | + restore-keys: | | ||
| 61 | + ${{ matrix.os }}-sccache-core- | ||
| 62 | + | ||
| 63 | + - name: Configure CMake | ||
| 64 | + shell: bash | ||
| 65 | + run: | | ||
| 66 | + mkdir build | ||
| 67 | + cd build | ||
| 68 | + cmake \ | ||
| 69 | + -D CMAKE_C_COMPILER_LAUNCHER=sccache \ | ||
| 70 | + -D CMAKE_CXX_COMPILER_LAUNCHER=sccache \ | ||
| 71 | + -A x64 \ | ||
| 72 | + -D SHERPA_ONNX_ENABLE_TTS=ON \ | ||
| 73 | + -D CMAKE_BUILD_TYPE=Release \ | ||
| 74 | + -D BUILD_SHARED_LIBS=ON \ | ||
| 75 | + -D SHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF \ | ||
| 76 | + -DCMAKE_INSTALL_PREFIX=./install \ | ||
| 77 | + .. | ||
| 78 | + | ||
| 79 | + - name: Build sherpa-onnx for windows | ||
| 80 | + shell: bash | ||
| 81 | + run: | | ||
| 82 | + cd build | ||
| 83 | + cmake --build . --config Release -- -m:2 | ||
| 84 | + cmake --build . --config Release --target install -- -m:2 | ||
| 85 | + | ||
| 86 | + ls -lh ./bin/Release/sherpa-onnx.exe | ||
| 87 | + | ||
| 88 | + - name: Show sccache stats | ||
| 89 | + run: sccache --show-stats | ||
| 90 | + | ||
| 91 | + - name: Show | ||
| 92 | + shell: bash | ||
| 93 | + run: | | ||
| 94 | + echo "---bin---" | ||
| 95 | + ls -lh build/install/bin | ||
| 96 | + echo "---lib---" | ||
| 97 | + ls -lh build/install/lib | ||
| 98 | + echo "---include---" | ||
| 99 | + ls -lh build/install/include | ||
| 100 | + | ||
| 101 | + - name: Copy files | ||
| 102 | + shell: bash | ||
| 103 | + run: | | ||
| 104 | + cd build | ||
| 105 | + echo 'sherpa-onnx-core' | ||
| 106 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 107 | + cp -v ./install/lib/onnxruntime.dll ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 108 | + cp -v ./install/lib/sherpa-onnx-*.dll ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 109 | + # keep the *.lib file so users can write code to link with our dll | ||
| 110 | + cp -v ./install/lib/sherpa-onnx-*.lib ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/lib | ||
| 111 | + | ||
| 112 | + mkdir -p ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 113 | + cp -v ./install/include/sherpa-onnx/c-api/*.h ../scripts/wheel/sherpa-onnx-core/sherpa_onnx/include/sherpa-onnx/c-api | ||
| 114 | + | ||
| 115 | + pushd ../scripts/wheel/sherpa-onnx-core | ||
| 116 | + python3 setup.py bdist_wheel --plat-name=win_amd64 | ||
| 117 | + | ||
| 118 | + ls -lh dist | ||
| 119 | + | ||
| 120 | + popd | ||
| 121 | + | ||
| 122 | + echo 'sherpa-onnx-bin' | ||
| 123 | + | ||
| 124 | + mkdir -p ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 125 | + cp -v ./install/bin/sherpa-onnx* ../scripts/wheel/sherpa-onnx-bin/bin | ||
| 126 | + | ||
| 127 | + pushd ../scripts/wheel/sherpa-onnx-bin | ||
| 128 | + python3 setup.py bdist_wheel --plat-name=win_amd64 | ||
| 129 | + | ||
| 130 | + ls -lh dist | ||
| 131 | + | ||
| 132 | + popd | ||
| 133 | + | ||
| 134 | + - name: Collect wheels | ||
| 135 | + shell: bash | ||
| 136 | + run: | | ||
| 137 | + mkdir wheelhouse | ||
| 138 | + cp -v ./scripts/wheel/sherpa-onnx-core/dist/*.whl ./wheelhouse | ||
| 139 | + cp -v ./scripts/wheel/sherpa-onnx-bin/dist/*.whl ./wheelhouse | ||
| 140 | + | ||
| 141 | + - uses: actions/upload-artifact@v4 | ||
| 142 | + with: | ||
| 143 | + name: wheels-core-win-x64 | ||
| 144 | + path: ./wheelhouse/*.whl | ||
| 145 | + | ||
| 146 | + - name: Show wheels | ||
| 147 | + shell: bash | ||
| 148 | + run: | | ||
| 149 | + ls -lh ./scripts/wheel/sherpa-onnx-core/dist | ||
| 150 | + ls -lh ./scripts/wheel/sherpa-onnx-bin/dist | ||
| 151 | + | ||
| 152 | + unzip -l ./scripts/wheel/sherpa-onnx-core/dist/*.whl | ||
| 153 | + echo "---" | ||
| 154 | + unzip -l ./scripts/wheel/sherpa-onnx-bin/dist/*.whl | ||
| 155 | + | ||
| 156 | + test: | ||
| 157 | + name: test | ||
| 158 | + needs: [core] | ||
| 159 | + runs-on: ${{ matrix.os }} | ||
| 160 | + strategy: | ||
| 161 | + fail-fast: false | ||
| 162 | + matrix: | ||
| 163 | + os: [windows-2022] | ||
| 164 | + | ||
| 165 | + steps: | ||
| 166 | + - uses: actions/checkout@v4 | ||
| 167 | + with: | ||
| 168 | + fetch-depth: 0 | ||
| 169 | + | ||
| 170 | + - name: Retrieve artifact from Windows x64 | ||
| 171 | + uses: actions/download-artifact@v4 | ||
| 172 | + with: | ||
| 173 | + name: wheels-core-win-x64 | ||
| 174 | + path: /tmp/wheels | ||
| 175 | + | ||
| 176 | + - name: Setup Python | ||
| 177 | + uses: actions/setup-python@v5 | ||
| 178 | + with: | ||
| 179 | + python-version: "3.10" | ||
| 180 | + | ||
| 181 | + - name: Show | ||
| 182 | + shell: bash | ||
| 183 | + run: | | ||
| 184 | + ls -lh /d/tmp/wheels | ||
| 185 | + | ||
| 186 | + - name: Install | ||
| 187 | + shell: bash | ||
| 188 | + run: | | ||
| 189 | + python3 -m pip install /d/tmp/wheels/*.whl | ||
| 190 | + | ||
| 191 | + - name: Show version | ||
| 192 | + shell: bash | ||
| 193 | + run: | | ||
| 194 | + sherpa-onnx-version | ||
| 195 | + | ||
| 196 | + which sherpa-onnx-version | ||
| 197 | + | ||
| 198 | + - name: Show help | ||
| 199 | + shell: bash | ||
| 200 | + run: | | ||
| 201 | + sherpa-onnx --help | ||
| 202 | + | ||
| 203 | + echo "---" | ||
| 204 | + | ||
| 205 | + sherpa-onnx-offline --help | ||
| 206 | + | ||
| 207 | + echo "---" | ||
| 208 | + | ||
| 209 | + sherpa-onnx-vad --help | ||
| 210 | + | ||
| 211 | + which sherpa-onnx-vad | ||
| 212 | + | ||
| 213 | + - name: Publish to huggingface | ||
| 214 | + env: | ||
| 215 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 216 | + uses: nick-fields/retry@v3 | ||
| 217 | + with: | ||
| 218 | + max_attempts: 20 | ||
| 219 | + timeout_seconds: 200 | ||
| 220 | + shell: bash | ||
| 221 | + command: | | ||
| 222 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 223 | + git config --global user.name "Fangjun Kuang" | ||
| 224 | + | ||
| 225 | + rm -rf huggingface | ||
| 226 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 227 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 228 | + | ||
| 229 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 230 | + echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
| 231 | + | ||
| 232 | + d=cpu/$SHERPA_ONNX_VERSION | ||
| 233 | + | ||
| 234 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels huggingface | ||
| 235 | + cd huggingface | ||
| 236 | + git fetch | ||
| 237 | + git pull | ||
| 238 | + git merge -m "merge remote" --ff origin main | ||
| 239 | + | ||
| 240 | + mkdir -p $d | ||
| 241 | + | ||
| 242 | + cp -v /d/tmp/wheels/*.whl $d/ | ||
| 243 | + | ||
| 244 | + git status | ||
| 245 | + git add . | ||
| 246 | + git commit -m "add more wheels" | ||
| 247 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-wheels main | ||
| 248 | + | ||
| 249 | + - name: Publish wheels to PyPI ${{ github.event.inputs.publish_sherpa_onnx_bin }} | ||
| 250 | + if: ${{ (github.event.inputs.publish_sherpa_onnx_bin || 'true') == 'true' }} | ||
| 251 | + env: | ||
| 252 | + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
| 253 | + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
| 254 | + shell: bash | ||
| 255 | + run: | | ||
| 256 | + python3 -m pip install --upgrade pip | ||
| 257 | + python3 -m pip install wheel twine==5.0.0 setuptools | ||
| 258 | + | ||
| 259 | + twine upload /d/tmp/wheels/*.whl | ||
| 260 | + | ||
| 17 | build_wheels_win64: | 261 | build_wheels_win64: |
| 262 | + needs: [core, test] | ||
| 18 | name: ${{ matrix.python-version }} | 263 | name: ${{ matrix.python-version }} |
| 19 | runs-on: ${{ matrix.os }} | 264 | runs-on: ${{ matrix.os }} |
| 20 | strategy: | 265 | strategy: |
| 21 | fail-fast: false | 266 | fail-fast: false |
| 22 | matrix: | 267 | matrix: |
| 23 | - os: [windows-2022] | 268 | + os: [windows-latest] |
| 24 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | 269 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] |
| 25 | 270 | ||
| 26 | steps: | 271 | steps: |
| @@ -37,10 +282,14 @@ jobs: | @@ -37,10 +282,14 @@ jobs: | ||
| 37 | with: | 282 | with: |
| 38 | python-version: ${{ matrix.python-version }} | 283 | python-version: ${{ matrix.python-version }} |
| 39 | 284 | ||
| 40 | - - name: Build wheels | 285 | + - name: Build wheels (cmd) |
| 41 | shell: bash | 286 | shell: bash |
| 42 | run: | | 287 | run: | |
| 43 | - pip install setuptools wheel | 288 | + python3 -m pip install setuptools wheel twine |
| 289 | + | ||
| 290 | + export SHERPA_ONNX_SPLIT_PYTHON_PACKAGE=ON | ||
| 291 | + | ||
| 292 | + export SHERPA_ONNX_CMAKE_ARGS="-DSHERPA_ONNX_ENABLE_BINARY=OFF -DSHERPA_ONNX_BUILD_C_API_EXAMPLES=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_C_API=OFF -DSHERPA_ONNX_ENABLE_WEBSOCKET=OFF" | ||
| 44 | 293 | ||
| 45 | python3 setup.py bdist_wheel | 294 | python3 setup.py bdist_wheel |
| 46 | 295 | ||
| @@ -52,6 +301,7 @@ jobs: | @@ -52,6 +301,7 @@ jobs: | ||
| 52 | shell: bash | 301 | shell: bash |
| 53 | run: | | 302 | run: | |
| 54 | ls -lh ./wheelhouse/ | 303 | ls -lh ./wheelhouse/ |
| 304 | + unzip -l ./wheelhouse/*.whl | ||
| 55 | 305 | ||
| 56 | - uses: actions/upload-artifact@v4 | 306 | - uses: actions/upload-artifact@v4 |
| 57 | with: | 307 | with: |
| @@ -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 | ||
| @@ -85,6 +75,66 @@ jobs: | @@ -85,6 +75,66 @@ jobs: | ||
| 85 | otool -L ./install/lib/libsherpa-onnx-c-api.dylib | 75 | otool -L ./install/lib/libsherpa-onnx-c-api.dylib |
| 86 | fi | 76 | fi |
| 87 | 77 | ||
| 78 | + - name: Test Wenet CTC | ||
| 79 | + shell: bash | ||
| 80 | + run: | | ||
| 81 | + name=wenet-ctc-c-api | ||
| 82 | + gcc -o $name ./c-api-examples/$name.c \ | ||
| 83 | + -I ./build/install/include \ | ||
| 84 | + -L ./build/install/lib/ \ | ||
| 85 | + -l sherpa-onnx-c-api \ | ||
| 86 | + -l onnxruntime | ||
| 87 | + | ||
| 88 | + ls -lh $name | ||
| 89 | + | ||
| 90 | + if [[ ${{ matrix.os }} == ubuntu-latest || ${{ matrix.os }} == ubuntu-22.04-arm ]]; then | ||
| 91 | + ldd ./$name | ||
| 92 | + echo "----" | ||
| 93 | + readelf -d ./$name | ||
| 94 | + fi | ||
| 95 | + | ||
| 96 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 97 | + tar xvf sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 98 | + rm sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 99 | + | ||
| 100 | + export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH | ||
| 101 | + export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH | ||
| 102 | + | ||
| 103 | + ./$name | ||
| 104 | + | ||
| 105 | + rm $name | ||
| 106 | + rm -rf sherpa-onnx-wenetspeech-* | ||
| 107 | + | ||
| 108 | + - name: Test T-one | ||
| 109 | + shell: bash | ||
| 110 | + run: | | ||
| 111 | + name=streaming-t-one-ctc-c-api | ||
| 112 | + gcc -o $name ./c-api-examples/$name.c \ | ||
| 113 | + -I ./build/install/include \ | ||
| 114 | + -L ./build/install/lib/ \ | ||
| 115 | + -l sherpa-onnx-c-api \ | ||
| 116 | + -l onnxruntime | ||
| 117 | + | ||
| 118 | + ls -lh $name | ||
| 119 | + | ||
| 120 | + if [[ ${{ matrix.os }} == ubuntu-latest || ${{ matrix.os }} == ubuntu-22.04-arm ]]; then | ||
| 121 | + ldd ./$name | ||
| 122 | + echo "----" | ||
| 123 | + readelf -d ./$name | ||
| 124 | + fi | ||
| 125 | + | ||
| 126 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 127 | + tar xvf sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 128 | + rm sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 129 | + | ||
| 130 | + export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH | ||
| 131 | + export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH | ||
| 132 | + | ||
| 133 | + ./$name | ||
| 134 | + | ||
| 135 | + rm $name | ||
| 136 | + rm -rf sherpa-onnx-streaming-t-one-russian-2025-09-08 | ||
| 137 | + | ||
| 88 | - name: Test KittenTTS | 138 | - name: Test KittenTTS |
| 89 | shell: bash | 139 | shell: bash |
| 90 | run: | | 140 | run: | |
| @@ -540,7 +590,8 @@ jobs: | @@ -540,7 +590,8 @@ jobs: | ||
| 540 | rm -rf sherpa-onnx-* | 590 | rm -rf sherpa-onnx-* |
| 541 | 591 | ||
| 542 | - name: Test ffmpeg | 592 | - name: Test ffmpeg |
| 543 | - if: matrix.os == 'macos-latest' | 593 | + # if: matrix.os == 'macos-latest' |
| 594 | + if: false | ||
| 544 | shell: bash | 595 | shell: bash |
| 545 | run: | | 596 | run: | |
| 546 | brew install ffmpeg | 597 | brew install ffmpeg |
| @@ -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 | ||
| @@ -87,6 +78,74 @@ jobs: | @@ -87,6 +78,74 @@ jobs: | ||
| 87 | otool -L ./install/lib/libsherpa-onnx-cxx-api.dylib | 78 | otool -L ./install/lib/libsherpa-onnx-cxx-api.dylib |
| 88 | fi | 79 | fi |
| 89 | 80 | ||
| 81 | + - name: Test Wenet CTC | ||
| 82 | + shell: bash | ||
| 83 | + run: | | ||
| 84 | + name=wenet-ctc-cxx-api | ||
| 85 | + g++ -std=c++17 -o $name ./cxx-api-examples/$name.cc \ | ||
| 86 | + -I ./build/install/include \ | ||
| 87 | + -L ./build/install/lib/ \ | ||
| 88 | + -l sherpa-onnx-cxx-api \ | ||
| 89 | + -l sherpa-onnx-c-api \ | ||
| 90 | + -l onnxruntime | ||
| 91 | + | ||
| 92 | + ls -lh $name | ||
| 93 | + | ||
| 94 | + if [[ ${{ matrix.os }} == ubuntu-latest || ${{ matrix.os }} == ubuntu-22.04-arm ]]; then | ||
| 95 | + ls -lh ./$name | ||
| 96 | + ldd ./$name | ||
| 97 | + echo "----" | ||
| 98 | + readelf -d ./$name | ||
| 99 | + fi | ||
| 100 | + | ||
| 101 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 102 | + tar xvf sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 103 | + rm sherpa-onnx-wenetspeech-yue-u2pp-conformer-ctc-zh-en-cantonese-int8-2025-09-10.tar.bz2 | ||
| 104 | + | ||
| 105 | + echo "---" | ||
| 106 | + | ||
| 107 | + export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH | ||
| 108 | + export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH | ||
| 109 | + | ||
| 110 | + ./$name | ||
| 111 | + | ||
| 112 | + rm -rf sherpa-onnx-wenetspeech-* | ||
| 113 | + rm -v ./$name | ||
| 114 | + | ||
| 115 | + - name: Test T-one | ||
| 116 | + shell: bash | ||
| 117 | + run: | | ||
| 118 | + name=streaming-t-one-ctc-cxx-api | ||
| 119 | + g++ -std=c++17 -o $name ./cxx-api-examples/$name.cc \ | ||
| 120 | + -I ./build/install/include \ | ||
| 121 | + -L ./build/install/lib/ \ | ||
| 122 | + -l sherpa-onnx-cxx-api \ | ||
| 123 | + -l sherpa-onnx-c-api \ | ||
| 124 | + -l onnxruntime | ||
| 125 | + | ||
| 126 | + ls -lh $name | ||
| 127 | + | ||
| 128 | + if [[ ${{ matrix.os }} == ubuntu-latest || ${{ matrix.os }} == ubuntu-22.04-arm ]]; then | ||
| 129 | + ls -lh ./$name | ||
| 130 | + ldd ./$name | ||
| 131 | + echo "----" | ||
| 132 | + readelf -d ./$name | ||
| 133 | + fi | ||
| 134 | + | ||
| 135 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 136 | + tar xvf sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 137 | + rm sherpa-onnx-streaming-t-one-russian-2025-09-08.tar.bz2 | ||
| 138 | + | ||
| 139 | + echo "---" | ||
| 140 | + | ||
| 141 | + export LD_LIBRARY_PATH=$PWD/build/install/lib:$LD_LIBRARY_PATH | ||
| 142 | + export DYLD_LIBRARY_PATH=$PWD/build/install/lib:$DYLD_LIBRARY_PATH | ||
| 143 | + | ||
| 144 | + ./$name | ||
| 145 | + | ||
| 146 | + rm -rf sherpa-onnx-streaming-t-one-russian-2025-09-08 | ||
| 147 | + rm -v ./$name | ||
| 148 | + | ||
| 90 | - name: Test KittenTTS | 149 | - name: Test KittenTTS |
| 91 | shell: bash | 150 | shell: bash |
| 92 | run: | | 151 | run: | |
| @@ -3,7 +3,7 @@ name: export-kitten-to-onnx | @@ -3,7 +3,7 @@ name: export-kitten-to-onnx | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | branches: | 5 | branches: |
| 6 | - - kitten-tts | 6 | + - kitten-0.2 |
| 7 | 7 | ||
| 8 | workflow_dispatch: | 8 | workflow_dispatch: |
| 9 | 9 | ||
| @@ -20,6 +20,7 @@ jobs: | @@ -20,6 +20,7 @@ jobs: | ||
| 20 | fail-fast: false | 20 | fail-fast: false |
| 21 | matrix: | 21 | matrix: |
| 22 | os: [ubuntu-latest] | 22 | os: [ubuntu-latest] |
| 23 | + version: ["nano_v0_1", "nano_v0_2", "mini_v0_1"] | ||
| 23 | python-version: ["3.10"] | 24 | python-version: ["3.10"] |
| 24 | 25 | ||
| 25 | steps: | 26 | steps: |
| @@ -40,7 +41,7 @@ jobs: | @@ -40,7 +41,7 @@ jobs: | ||
| 40 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 41 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 41 | shell: bash | 42 | shell: bash |
| 42 | run: | | 43 | run: | |
| 43 | - cd scripts/kitten-tts/nano_v0_1 | 44 | + cd scripts/kitten-tts/${{ matrix.version }} |
| 44 | ./run.sh | 45 | ./run.sh |
| 45 | 46 | ||
| 46 | - name: Collect results | 47 | - name: Collect results |
| @@ -50,9 +51,20 @@ jobs: | @@ -50,9 +51,20 @@ jobs: | ||
| 50 | tar xf espeak-ng-data.tar.bz2 | 51 | tar xf espeak-ng-data.tar.bz2 |
| 51 | rm espeak-ng-data.tar.bz2 | 52 | rm espeak-ng-data.tar.bz2 |
| 52 | 53 | ||
| 53 | - src=scripts/kitten-tts/nano_v0_1 | 54 | + version=${{ matrix.version }} |
| 54 | 55 | ||
| 55 | - d=kitten-nano-en-v0_1-fp16 | 56 | + src=scripts/kitten-tts/$version |
| 57 | + | ||
| 58 | + if [[ $version == "nano_v0_1" ]]; then | ||
| 59 | + d=kitten-nano-en-v0_1-fp16 | ||
| 60 | + elif [[ $version == "nano_v0_2" ]]; then | ||
| 61 | + d=kitten-nano-en-v0_2-fp16 | ||
| 62 | + elif [[ $version == "mini_v0_1" ]]; then | ||
| 63 | + d=kitten-mini-en-v0_1-fp16 | ||
| 64 | + else | ||
| 65 | + echo "version $version" | ||
| 66 | + exit 1 | ||
| 67 | + fi | ||
| 56 | 68 | ||
| 57 | mkdir $d | 69 | mkdir $d |
| 58 | cp -a LICENSE $d/LICENSE | 70 | cp -a LICENSE $d/LICENSE |
| @@ -100,12 +112,21 @@ jobs: | @@ -100,12 +112,21 @@ jobs: | ||
| 100 | 112 | ||
| 101 | dirs=( | 113 | dirs=( |
| 102 | kitten-nano-en-v0_1-fp16 | 114 | kitten-nano-en-v0_1-fp16 |
| 115 | + kitten-nano-en-v0_2-fp16 | ||
| 116 | + kitten-mini-en-v0_1-fp16 | ||
| 103 | ) | 117 | ) |
| 104 | 118 | ||
| 105 | export GIT_LFS_SKIP_SMUDGE=1 | 119 | export GIT_LFS_SKIP_SMUDGE=1 |
| 106 | export GIT_CLONE_PROTECTION_ACTIVE=false | 120 | export GIT_CLONE_PROTECTION_ACTIVE=false |
| 107 | 121 | ||
| 108 | for d in ${dirs[@]}; do | 122 | for d in ${dirs[@]}; do |
| 123 | + echo "d $d" | ||
| 124 | + if [[ ! -d $d ]]; then | ||
| 125 | + echo "$d does not exist" | ||
| 126 | + continue | ||
| 127 | + fi | ||
| 128 | + | ||
| 129 | + echo "$d exists" | ||
| 109 | rm -rf huggingface | 130 | rm -rf huggingface |
| 110 | 131 | ||
| 111 | git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$d huggingface | 132 | git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$d huggingface |
| @@ -3,7 +3,7 @@ name: export-matcha-fa-en-to-onnx | @@ -3,7 +3,7 @@ name: export-matcha-fa-en-to-onnx | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| 5 | branches: | 5 | branches: |
| 6 | - - fix-ci | 6 | + - tts-matcha-samples |
| 7 | 7 | ||
| 8 | workflow_dispatch: | 8 | workflow_dispatch: |
| 9 | 9 | ||
| @@ -33,15 +33,48 @@ jobs: | @@ -33,15 +33,48 @@ jobs: | ||
| 33 | - name: Install Python dependencies | 33 | - name: Install Python dependencies |
| 34 | shell: bash | 34 | shell: bash |
| 35 | run: | | 35 | run: | |
| 36 | - pip install "numpy<=1.26.4" onnx==1.16.0 onnxruntime==1.17.1 soundfile piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html | 36 | + pip install "numpy<=1.26.4" onnx==1.16.0 onnxruntime==1.17.1 soundfile piper_phonemize -f https://k2-fsa.github.io/icefall/piper_phonemize.html sherpa-onnx |
| 37 | 37 | ||
| 38 | - name: Run | 38 | - name: Run |
| 39 | + if: false | ||
| 39 | shell: bash | 40 | shell: bash |
| 40 | run: | | 41 | run: | |
| 41 | cd scripts/matcha-tts/fa-en | 42 | cd scripts/matcha-tts/fa-en |
| 42 | ./run.sh | 43 | ./run.sh |
| 43 | 44 | ||
| 45 | + - name: Generate samples | ||
| 46 | + env: | ||
| 47 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 48 | + shell: bash | ||
| 49 | + run: | | ||
| 50 | + cd scripts/matcha-tts/zh | ||
| 51 | + | ||
| 52 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 53 | + git config --global user.name "Fangjun Kuang" | ||
| 54 | + | ||
| 55 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-zh-baker.tar.bz2 | ||
| 56 | + tar xvf matcha-icefall-zh-baker.tar.bz2 | ||
| 57 | + rm matcha-icefall-zh-baker.tar.bz2 | ||
| 58 | + | ||
| 59 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx | ||
| 60 | + | ||
| 61 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-tts-samples hf | ||
| 62 | + mkdir -p ./hf/matcha/icefall-zh/mp3 | ||
| 63 | + | ||
| 64 | + ./generate_samples.py | ||
| 65 | + | ||
| 66 | + pushd hf | ||
| 67 | + git pull | ||
| 68 | + git add . | ||
| 69 | + git commit -m 'add kokoro samples for matcha tts zh' | ||
| 70 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-tts-samples main | ||
| 71 | + popd | ||
| 72 | + rm -rf hf | ||
| 73 | + | ||
| 74 | + ls -lh | ||
| 75 | + | ||
| 44 | - name: Collect results ${{ matrix.version }} | 76 | - name: Collect results ${{ matrix.version }} |
| 77 | + if: false | ||
| 45 | shell: bash | 78 | shell: bash |
| 46 | run: | | 79 | run: | |
| 47 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/espeak-ng-data.tar.bz2 | 80 | curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/espeak-ng-data.tar.bz2 |
| @@ -73,6 +106,7 @@ jobs: | @@ -73,6 +106,7 @@ jobs: | ||
| 73 | ls -lh $dst2.tar.bz2 | 106 | ls -lh $dst2.tar.bz2 |
| 74 | 107 | ||
| 75 | - name: Publish to huggingface male (musa) | 108 | - name: Publish to huggingface male (musa) |
| 109 | + if: false | ||
| 76 | env: | 110 | env: |
| 77 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 111 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 78 | uses: nick-fields/retry@v3 | 112 | uses: nick-fields/retry@v3 |
| @@ -110,6 +144,7 @@ jobs: | @@ -110,6 +144,7 @@ jobs: | ||
| 110 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/matcha-tts-fa_en-musa main || true | 144 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/matcha-tts-fa_en-musa main || true |
| 111 | 145 | ||
| 112 | - name: Publish to huggingface female (khadijah) | 146 | - name: Publish to huggingface female (khadijah) |
| 147 | + if: false | ||
| 113 | env: | 148 | env: |
| 114 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 149 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 115 | uses: nick-fields/retry@v3 | 150 | uses: nick-fields/retry@v3 |
| @@ -147,7 +182,8 @@ jobs: | @@ -147,7 +182,8 @@ jobs: | ||
| 147 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/matcha-tts-fa_en-khadijah main || true | 182 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/matcha-tts-fa_en-khadijah main || true |
| 148 | 183 | ||
| 149 | - name: Release | 184 | - name: Release |
| 150 | - if: github.repository_owner == 'csukuangfj' | 185 | + # if: github.repository_owner == 'csukuangfj' |
| 186 | + if: false | ||
| 151 | uses: svenstaro/upload-release-action@v2 | 187 | uses: svenstaro/upload-release-action@v2 |
| 152 | with: | 188 | with: |
| 153 | file_glob: true | 189 | file_glob: true |
| @@ -158,7 +194,8 @@ jobs: | @@ -158,7 +194,8 @@ jobs: | ||
| 158 | tag: tts-models | 194 | tag: tts-models |
| 159 | 195 | ||
| 160 | - name: Release | 196 | - name: Release |
| 161 | - if: github.repository_owner == 'k2-fsa' | 197 | + # if: github.repository_owner == 'k2-fsa' |
| 198 | + if: false | ||
| 162 | uses: svenstaro/upload-release-action@v2 | 199 | uses: svenstaro/upload-release-action@v2 |
| 163 | with: | 200 | with: |
| 164 | file_glob: true | 201 | file_glob: true |
| 1 | -name: export-nemo-parakeet-tdt-0.6b-v2 | 1 | +name: export-nemo-parakeet-tdt-0.6b |
| 2 | 2 | ||
| 3 | on: | 3 | on: |
| 4 | push: | 4 | push: |
| @@ -10,81 +10,111 @@ concurrency: | @@ -10,81 +10,111 @@ concurrency: | ||
| 10 | group: export-nemo-parakeet-tdt-0.6b-v2-${{ github.ref }} | 10 | group: export-nemo-parakeet-tdt-0.6b-v2-${{ github.ref }} |
| 11 | cancel-in-progress: true | 11 | cancel-in-progress: true |
| 12 | 12 | ||
| 13 | +env: | ||
| 14 | + HF_HUB_ENABLE_HF_TRANSFER: "0" | ||
| 15 | + | ||
| 13 | jobs: | 16 | jobs: |
| 14 | - export-nemo-parakeet-tdt-0_6b-v2: | 17 | + export-nemo-parakeet-tdt-0_6b: |
| 15 | if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj' | 18 | if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj' |
| 16 | - name: parakeet tdt 0.6b v2 | 19 | + name: parakeet tdt 0.6b ${{ matrix.version }} |
| 17 | runs-on: ${{ matrix.os }} | 20 | runs-on: ${{ matrix.os }} |
| 18 | strategy: | 21 | strategy: |
| 19 | fail-fast: false | 22 | fail-fast: false |
| 20 | matrix: | 23 | matrix: |
| 21 | os: [macos-latest] | 24 | os: [macos-latest] |
| 22 | python-version: ["3.10"] | 25 | python-version: ["3.10"] |
| 26 | + version: ["v2", "v3"] | ||
| 23 | 27 | ||
| 24 | steps: | 28 | steps: |
| 25 | - uses: actions/checkout@v4 | 29 | - uses: actions/checkout@v4 |
| 26 | 30 | ||
| 31 | + - name: Show disk space | ||
| 32 | + run: | | ||
| 33 | + df -h | ||
| 34 | + | ||
| 35 | + # See https://github.com/vlayer-xyz/vlayer/pull/543/files | ||
| 36 | + # Free up disk space as the macOS runners end up using most for Xcode | ||
| 37 | + # versions we don't need and use iOS simulators. | ||
| 38 | + - name: Free up disk space | ||
| 39 | + run: | | ||
| 40 | + echo '*** Delete iOS simulators and their caches' | ||
| 41 | + xcrun simctl delete all | ||
| 42 | + sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/* | ||
| 43 | + | ||
| 44 | + - name: Show disk space | ||
| 45 | + run: | | ||
| 46 | + df -h | ||
| 47 | + | ||
| 27 | - name: Setup Python ${{ matrix.python-version }} | 48 | - name: Setup Python ${{ matrix.python-version }} |
| 28 | uses: actions/setup-python@v5 | 49 | uses: actions/setup-python@v5 |
| 29 | with: | 50 | with: |
| 30 | python-version: ${{ matrix.python-version }} | 51 | python-version: ${{ matrix.python-version }} |
| 31 | 52 | ||
| 32 | - - name: Run | 53 | + - name: Run ${{ matrix.version }} |
| 54 | + if: matrix.version == 'v2' | ||
| 33 | shell: bash | 55 | shell: bash |
| 34 | run: | | 56 | run: | |
| 35 | cd scripts/nemo/parakeet-tdt-0.6b-v2 | 57 | cd scripts/nemo/parakeet-tdt-0.6b-v2 |
| 36 | ./run.sh | 58 | ./run.sh |
| 37 | 59 | ||
| 38 | ls -lh *.onnx | 60 | ls -lh *.onnx |
| 61 | + ls -lh *.weights | ||
| 62 | + | ||
| 39 | mv -v *.onnx ../../.. | 63 | mv -v *.onnx ../../.. |
| 64 | + mv -v *.weights ../../.. | ||
| 40 | mv -v tokens.txt ../../.. | 65 | mv -v tokens.txt ../../.. |
| 41 | mv 2086-149220-0033.wav ../../../0.wav | 66 | mv 2086-149220-0033.wav ../../../0.wav |
| 42 | 67 | ||
| 43 | - - name: Collect files (fp32) | 68 | + - name: Run ${{ matrix.version }} |
| 69 | + if: matrix.version == 'v3' | ||
| 44 | shell: bash | 70 | shell: bash |
| 45 | run: | | 71 | run: | |
| 46 | - d=sherpa-onnx-nemo-parakeet-tdt-0.6b-v2 | ||
| 47 | - mkdir -p $d | ||
| 48 | - cp encoder.int8.onnx $d | ||
| 49 | - cp decoder.onnx $d | ||
| 50 | - cp joiner.onnx $d | ||
| 51 | - cp tokens.txt $d | ||
| 52 | - | ||
| 53 | - mkdir $d/test_wavs | ||
| 54 | - cp 0.wav $d/test_wavs | 72 | + cd scripts/nemo/parakeet-tdt-0.6b-v3 |
| 73 | + ./run.sh | ||
| 55 | 74 | ||
| 56 | - tar cjfv $d.tar.bz2 $d | 75 | + ls -lh *.onnx |
| 76 | + mv -v *.onnx ../../.. | ||
| 77 | + mv -v *.weights ../../.. | ||
| 78 | + mv -v tokens.txt ../../.. | ||
| 79 | + mv *.wav ../../../ | ||
| 57 | 80 | ||
| 58 | - - name: Collect files (int8) | 81 | + - name: Collect files (fp32) |
| 59 | shell: bash | 82 | shell: bash |
| 60 | run: | | 83 | run: | |
| 61 | - d=sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8 | 84 | + version=${{ matrix.version }} |
| 85 | + d=sherpa-onnx-nemo-parakeet-tdt-0.6b-$version | ||
| 62 | mkdir -p $d | 86 | mkdir -p $d |
| 63 | - cp encoder.int8.onnx $d | ||
| 64 | - cp decoder.int8.onnx $d | ||
| 65 | - cp joiner.int8.onnx $d | ||
| 66 | - cp tokens.txt $d | 87 | + cp -v encoder.onnx $d |
| 88 | + cp -v encoder.weights $d | ||
| 89 | + cp -v decoder.onnx $d | ||
| 90 | + cp -v joiner.onnx $d | ||
| 91 | + cp -v tokens.txt $d | ||
| 67 | 92 | ||
| 68 | mkdir $d/test_wavs | 93 | mkdir $d/test_wavs |
| 69 | - cp 0.wav $d/test_wavs | 94 | + cp -v *.wav $d/test_wavs |
| 70 | 95 | ||
| 71 | - tar cjfv $d.tar.bz2 $d | 96 | + # tar cjfv $d.tar.bz2 $d |
| 97 | + | ||
| 98 | + # ls -lh *.tar.bz2 | ||
| 72 | 99 | ||
| 73 | - - name: Collect files (fp16) | 100 | + - name: Collect files (int8) |
| 74 | shell: bash | 101 | shell: bash |
| 75 | run: | | 102 | run: | |
| 76 | - d=sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-fp16 | 103 | + version=${{ matrix.version }} |
| 104 | + d=sherpa-onnx-nemo-parakeet-tdt-0.6b-$version-int8 | ||
| 77 | mkdir -p $d | 105 | mkdir -p $d |
| 78 | - cp encoder.fp16.onnx $d | ||
| 79 | - cp decoder.fp16.onnx $d | ||
| 80 | - cp joiner.fp16.onnx $d | ||
| 81 | - cp tokens.txt $d | 106 | + cp -v encoder.int8.onnx $d |
| 107 | + cp -v decoder.int8.onnx $d | ||
| 108 | + cp -v joiner.int8.onnx $d | ||
| 109 | + cp -v tokens.txt $d | ||
| 82 | 110 | ||
| 83 | mkdir $d/test_wavs | 111 | mkdir $d/test_wavs |
| 84 | - cp 0.wav $d/test_wavs | 112 | + cp -v *.wav $d/test_wavs |
| 85 | 113 | ||
| 86 | tar cjfv $d.tar.bz2 $d | 114 | tar cjfv $d.tar.bz2 $d |
| 87 | 115 | ||
| 116 | + ls -lh *.tar.bz2 | ||
| 117 | + | ||
| 88 | - name: Publish to huggingface | 118 | - name: Publish to huggingface |
| 89 | env: | 119 | env: |
| 90 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 120 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| @@ -94,13 +124,13 @@ jobs: | @@ -94,13 +124,13 @@ jobs: | ||
| 94 | timeout_seconds: 200 | 124 | timeout_seconds: 200 |
| 95 | shell: bash | 125 | shell: bash |
| 96 | command: | | 126 | command: | |
| 127 | + version=${{ matrix.version }} | ||
| 97 | git config --global user.email "csukuangfj@gmail.com" | 128 | git config --global user.email "csukuangfj@gmail.com" |
| 98 | git config --global user.name "Fangjun Kuang" | 129 | git config --global user.name "Fangjun Kuang" |
| 99 | 130 | ||
| 100 | models=( | 131 | models=( |
| 101 | - sherpa-onnx-nemo-parakeet-tdt-0.6b-v2 | ||
| 102 | - sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-int8 | ||
| 103 | - sherpa-onnx-nemo-parakeet-tdt-0.6b-v2-fp16 | 132 | + sherpa-onnx-nemo-parakeet-tdt-0.6b-$version |
| 133 | + sherpa-onnx-nemo-parakeet-tdt-0.6b-$version-int8 | ||
| 104 | ) | 134 | ) |
| 105 | 135 | ||
| 106 | for m in ${models[@]}; do | 136 | for m in ${models[@]}; do |
| @@ -112,6 +142,7 @@ jobs: | @@ -112,6 +142,7 @@ jobs: | ||
| 112 | cd huggingface | 142 | cd huggingface |
| 113 | git lfs track "*.onnx" | 143 | git lfs track "*.onnx" |
| 114 | git lfs track "*.wav" | 144 | git lfs track "*.wav" |
| 145 | + git lfs track "*.weights" | ||
| 115 | git status | 146 | git status |
| 116 | git add . | 147 | git add . |
| 117 | git status | 148 | git status |
| @@ -158,8 +158,15 @@ jobs: | @@ -158,8 +158,15 @@ jobs: | ||
| 158 | vits-piper-nl_NL-miro-high | 158 | vits-piper-nl_NL-miro-high |
| 159 | vits-piper-nl_NL-dii-high | 159 | vits-piper-nl_NL-dii-high |
| 160 | vits-piper-de_DE-miro-high | 160 | vits-piper-de_DE-miro-high |
| 161 | + vits-piper-de_DE-dii-high | ||
| 161 | vits-piper-fr_FR-miro-high | 162 | vits-piper-fr_FR-miro-high |
| 162 | vits-piper-en_US-miro-high | 163 | vits-piper-en_US-miro-high |
| 164 | + vits-piper-pl_PL-jarvis_wg_glos-medium | ||
| 165 | + vits-piper-pl_PL-justyna_wg_glos-medium | ||
| 166 | + vits-piper-pl_PL-meski_wg_glos-medium | ||
| 167 | + vits-piper-pl_PL-zenski_wg_glos-medium | ||
| 168 | + vits-piper-id_ID-news_tts-medium | ||
| 169 | + vits-piper-hi_IN-rohan-medium | ||
| 163 | ) | 170 | ) |
| 164 | for d in ${dirs[@]}; do | 171 | for d in ${dirs[@]}; do |
| 165 | src=scripts/piper/release/$d | 172 | src=scripts/piper/release/$d |
| 1 | +name: export-sense-voice-to-rknn | ||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + push: | ||
| 5 | + branches: | ||
| 6 | + - export-sense-voice-rknn-ci-2 | ||
| 7 | + workflow_dispatch: | ||
| 8 | + | ||
| 9 | +concurrency: | ||
| 10 | + group: export-sense-voice-to-rknn-${{ github.ref }} | ||
| 11 | + cancel-in-progress: true | ||
| 12 | + | ||
| 13 | +jobs: | ||
| 14 | + export-sense-voice-to-rknn: | ||
| 15 | + if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj' | ||
| 16 | + name: ${{ matrix.framework }} ${{ matrix.platform }} ${{ matrix.input_in_seconds }} | ||
| 17 | + runs-on: ${{ matrix.os }} | ||
| 18 | + strategy: | ||
| 19 | + fail-fast: false | ||
| 20 | + matrix: | ||
| 21 | + os: [ubuntu-latest] | ||
| 22 | + python-version: ["3.10"] | ||
| 23 | + platform: ["rk3562", "rk3566", "rk3568", "rk3576", "rk3588"] | ||
| 24 | + input_in_seconds: ["10", "15", "20", "25", "30"] | ||
| 25 | + framework: ["FunASR", "WSYue-ASR"] | ||
| 26 | + | ||
| 27 | + steps: | ||
| 28 | + - uses: actions/checkout@v4 | ||
| 29 | + | ||
| 30 | + - name: Setup Python ${{ matrix.python-version }} | ||
| 31 | + uses: actions/setup-python@v5 | ||
| 32 | + with: | ||
| 33 | + python-version: ${{ matrix.python-version }} | ||
| 34 | + | ||
| 35 | + - name: Install Python dependencies | ||
| 36 | + shell: bash | ||
| 37 | + run: | | ||
| 38 | + python3 -m pip install --upgrade \ | ||
| 39 | + pip \ | ||
| 40 | + "numpy<2" \ | ||
| 41 | + torch==2.0.0+cpu -f https://download.pytorch.org/whl/torch \ | ||
| 42 | + onnx==1.17.0 \ | ||
| 43 | + onnxruntime==1.17.1 \ | ||
| 44 | + librosa \ | ||
| 45 | + soundfile \ | ||
| 46 | + onnxsim \ | ||
| 47 | + sentencepiece \ | ||
| 48 | + kaldi_native_fbank | ||
| 49 | + | ||
| 50 | + curl -SL -O https://huggingface.co/csukuangfj/rknn-toolkit2/resolve/main/rknn_toolkit2-2.1.0%2B708089d1-cp310-cp310-linux_x86_64.whl | ||
| 51 | + pip install ./*.whl "numpy<=1.26.4" | ||
| 52 | + | ||
| 53 | + - name: Run SenseVoice from FunAsr | ||
| 54 | + if: matrix.framework == 'FunASR' | ||
| 55 | + shell: bash | ||
| 56 | + run: | | ||
| 57 | + cd scripts/sense-voice/rknn | ||
| 58 | + | ||
| 59 | + curl -SL -O https://hf-mirror.com/FunAudioLLM/SenseVoiceSmall/resolve/main/am.mvn | ||
| 60 | + curl -SL -O https://hf-mirror.com/FunAudioLLM/SenseVoiceSmall/resolve/main/model.pt | ||
| 61 | + curl -SL -O https://hf-mirror.com/FunAudioLLM/SenseVoiceSmall/resolve/main/chn_jpn_yue_eng_ko_spectok.bpe.model | ||
| 62 | + | ||
| 63 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/en.wav | ||
| 64 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/ja.wav | ||
| 65 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/ko.wav | ||
| 66 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/yue.wav | ||
| 67 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/zh.wav | ||
| 68 | + | ||
| 69 | + rm -f README.md || true | ||
| 70 | + | ||
| 71 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/README.md | ||
| 72 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/LICENSE | ||
| 73 | + | ||
| 74 | + echo "export to onnx" | ||
| 75 | + t=${{ matrix.input_in_seconds }} | ||
| 76 | + p=${{ matrix.platform }} | ||
| 77 | + | ||
| 78 | + echo "----$t---" | ||
| 79 | + python3 ./export-onnx.py --input-len-in-seconds $t | ||
| 80 | + | ||
| 81 | + ls -lh *.onnx | ||
| 82 | + | ||
| 83 | + echo "test exported onnx models" | ||
| 84 | + | ||
| 85 | + echo "----------$t----------" | ||
| 86 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./en.wav | ||
| 87 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./ja.wav | ||
| 88 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./ko.wav | ||
| 89 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./yue.wav | ||
| 90 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./zh.wav | ||
| 91 | + | ||
| 92 | + echo "export to rknn" | ||
| 93 | + echo "----------$t----------" | ||
| 94 | + echo "----------$p----------" | ||
| 95 | + python3 export-rknn.py --target-platform $p --in-model model-$t-seconds.onnx --out-model model-$p-$t-seconds.rknn >/dev/null 2>&1 | ||
| 96 | + | ||
| 97 | + ls -lh *.rknn | ||
| 98 | + | ||
| 99 | + echo "collect results" | ||
| 100 | + d=sherpa-onnx-$p-$t-seconds-sense-voice-zh-en-ja-ko-yue-2024-07-17 | ||
| 101 | + | ||
| 102 | + mkdir -p $d | ||
| 103 | + mkdir -p $d/test_wavs | ||
| 104 | + | ||
| 105 | + cp -v README.md $d | ||
| 106 | + cp -v LICENSE $d | ||
| 107 | + cp -v model-$p-$t-seconds.rknn $d/model.rknn | ||
| 108 | + cp -v tokens.txt $d | ||
| 109 | + cp -v *.wav $d/test_wavs | ||
| 110 | + ls -lh $d | ||
| 111 | + tar cjfv $d.tar.bz2 $d | ||
| 112 | + ls -lh *.tar.bz2 | ||
| 113 | + rm -rf d | ||
| 114 | + | ||
| 115 | + echo "----show---" | ||
| 116 | + ls -lh *.tar.bz2 | ||
| 117 | + | ||
| 118 | + mv *.tar.bz2 ../../.. | ||
| 119 | + | ||
| 120 | + - name: Run SenseVoice from WSYue-ASR | ||
| 121 | + if: matrix.framework == 'WSYue-ASR' | ||
| 122 | + shell: bash | ||
| 123 | + run: | | ||
| 124 | + cd scripts/sense-voice/rknn | ||
| 125 | + | ||
| 126 | + curl -SL -O https://huggingface.co/ASLP-lab/WSYue-ASR/resolve/main/sensevoice_small_yue/model.pt | ||
| 127 | + | ||
| 128 | + curl -SL -O https://hf-mirror.com/FunAudioLLM/SenseVoiceSmall/resolve/main/am.mvn | ||
| 129 | + curl -SL -O https://hf-mirror.com/FunAudioLLM/SenseVoiceSmall/resolve/main/chn_jpn_yue_eng_ko_spectok.bpe.model | ||
| 130 | + | ||
| 131 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/en.wav | ||
| 132 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/yue.wav | ||
| 133 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17/resolve/main/test_wavs/zh.wav | ||
| 134 | + | ||
| 135 | + for i in $(seq 0 17); do | ||
| 136 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-int8-2025-09-09/resolve/main/test_wavs/yue-$i.wav | ||
| 137 | + done | ||
| 138 | + | ||
| 139 | + rm -f README.md || true | ||
| 140 | + | ||
| 141 | + curl -SL -O https://huggingface.co/csukuangfj/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-int8-2025-09-09/resolve/main/README.md | ||
| 142 | + | ||
| 143 | + echo "export to onnx" | ||
| 144 | + t=${{ matrix.input_in_seconds }} | ||
| 145 | + p=${{ matrix.platform }} | ||
| 146 | + | ||
| 147 | + echo "----$t---" | ||
| 148 | + | ||
| 149 | + export model_author="ASLP-lab" | ||
| 150 | + export comment="ASLP-lab/WSYue-ASR" | ||
| 151 | + export url="https://huggingface.co/ASLP-lab/WSYue-ASR/tree/main/sensevoice_small_yue" | ||
| 152 | + | ||
| 153 | + python3 ./export-onnx.py --input-len-in-seconds $t | ||
| 154 | + | ||
| 155 | + ls -lh *.onnx | ||
| 156 | + | ||
| 157 | + echo "test exported onnx models" | ||
| 158 | + | ||
| 159 | + echo "----------$t----------" | ||
| 160 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./en.wav | ||
| 161 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./yue.wav | ||
| 162 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./zh.wav | ||
| 163 | + for i in $(seq 0 17); do | ||
| 164 | + echo "yue-$i.wav" | ||
| 165 | + python3 ./test_onnx.py --model model-$t-seconds.onnx --tokens ./tokens.txt --wave ./yue-$i.wav | ||
| 166 | + done | ||
| 167 | + | ||
| 168 | + echo "export to rknn" | ||
| 169 | + echo "----------$t----------" | ||
| 170 | + echo "----------$p----------" | ||
| 171 | + python3 export-rknn.py --target-platform $p --in-model model-$t-seconds.onnx --out-model model-$p-$t-seconds.rknn >/dev/null 2>&1 | ||
| 172 | + | ||
| 173 | + ls -lh *.rknn | ||
| 174 | + | ||
| 175 | + echo "collect results" | ||
| 176 | + d=sherpa-onnx-$p-$t-seconds-sense-voice-zh-en-ja-ko-yue-2025-09-09 | ||
| 177 | + | ||
| 178 | + mkdir -p $d | ||
| 179 | + mkdir -p $d/test_wavs | ||
| 180 | + | ||
| 181 | + cp -v README.md $d | ||
| 182 | + cp -v model-$p-$t-seconds.rknn $d/model.rknn | ||
| 183 | + cp -v tokens.txt $d | ||
| 184 | + cp -v *.wav $d/test_wavs | ||
| 185 | + ls -lh $d | ||
| 186 | + tar cjfv $d.tar.bz2 $d | ||
| 187 | + ls -lh *.tar.bz2 | ||
| 188 | + rm -rf d | ||
| 189 | + | ||
| 190 | + echo "----show---" | ||
| 191 | + ls -lh *.tar.bz2 | ||
| 192 | + | ||
| 193 | + mv *.tar.bz2 ../../.. | ||
| 194 | + | ||
| 195 | + - name: Release | ||
| 196 | + if: github.repository_owner == 'csukuangfj' | ||
| 197 | + uses: svenstaro/upload-release-action@v2 | ||
| 198 | + with: | ||
| 199 | + file_glob: true | ||
| 200 | + file: ./*.tar.bz2 | ||
| 201 | + overwrite: true | ||
| 202 | + repo_name: k2-fsa/sherpa-onnx | ||
| 203 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 204 | + tag: asr-models | ||
| 205 | + | ||
| 206 | + - name: Release | ||
| 207 | + if: github.repository_owner == 'k2-fsa' | ||
| 208 | + uses: svenstaro/upload-release-action@v2 | ||
| 209 | + with: | ||
| 210 | + file_glob: true | ||
| 211 | + file: ./*.tar.bz2 | ||
| 212 | + overwrite: true | ||
| 213 | + tag: asr-models |
.github/workflows/export-t-one-to-onnx.yaml
0 → 100644
| 1 | +name: export-t-one-to-onnx | ||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + workflow_dispatch: | ||
| 5 | + | ||
| 6 | +concurrency: | ||
| 7 | + group: export-t-one-to-onnx-${{ github.ref }} | ||
| 8 | + cancel-in-progress: true | ||
| 9 | + | ||
| 10 | +jobs: | ||
| 11 | + export-t-one-to-onnx: | ||
| 12 | + if: github.repository_owner == 'k2-fsa' || github.repository_owner == 'csukuangfj' | ||
| 13 | + name: export t-one | ||
| 14 | + runs-on: ${{ matrix.os }} | ||
| 15 | + strategy: | ||
| 16 | + fail-fast: false | ||
| 17 | + matrix: | ||
| 18 | + os: [ubuntu-latest] | ||
| 19 | + python-version: ["3.10"] | ||
| 20 | + | ||
| 21 | + steps: | ||
| 22 | + - uses: actions/checkout@v4 | ||
| 23 | + | ||
| 24 | + - name: Setup Python ${{ matrix.python-version }} | ||
| 25 | + uses: actions/setup-python@v5 | ||
| 26 | + with: | ||
| 27 | + python-version: ${{ matrix.python-version }} | ||
| 28 | + | ||
| 29 | + - name: Install Python dependencies | ||
| 30 | + shell: bash | ||
| 31 | + run: | | ||
| 32 | + pip install onnx==1.17.0 onnxruntime==1.17.1 soundfile librosa kaldi_native_fbank "numpy<2" | ||
| 33 | + | ||
| 34 | + - name: Run | ||
| 35 | + shell: bash | ||
| 36 | + run: | | ||
| 37 | + cd scripts/t-one | ||
| 38 | + | ||
| 39 | + wget https://raw.githubusercontent.com/voicekit-team/T-one/refs/heads/main/LICENSE | ||
| 40 | + ./run.sh | ||
| 41 | + | ||
| 42 | + d=sherpa-onnx-streaming-t-one-russian-2025-09-08 | ||
| 43 | + mkdir $d | ||
| 44 | + cp -v ./tokens.txt $d | ||
| 45 | + cp -v ./model.onnx $d | ||
| 46 | + cp -v ./russian_test_short_from_t_one.wav $d/0.wav | ||
| 47 | + cp -v ./LICENSE $d | ||
| 48 | + cp -v ./README.md $d | ||
| 49 | + | ||
| 50 | + ls -lh $d | ||
| 51 | + | ||
| 52 | + tar cjfv $d.tar.bz2 $d | ||
| 53 | + | ||
| 54 | + ls -lh $d.tar.bz2 | ||
| 55 | + | ||
| 56 | + mv $d.tar.bz2 ../.. | ||
| 57 | + mv $d ../.. | ||
| 58 | + | ||
| 59 | + - name: Publish to huggingface | ||
| 60 | + env: | ||
| 61 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 62 | + uses: nick-fields/retry@v3 | ||
| 63 | + with: | ||
| 64 | + max_attempts: 20 | ||
| 65 | + timeout_seconds: 200 | ||
| 66 | + shell: bash | ||
| 67 | + command: | | ||
| 68 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 69 | + git config --global user.name "Fangjun Kuang" | ||
| 70 | + | ||
| 71 | + rm -rf huggingface | ||
| 72 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 73 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 74 | + | ||
| 75 | + m=sherpa-onnx-streaming-t-one-russian-2025-09-08 | ||
| 76 | + | ||
| 77 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$m huggingface | ||
| 78 | + cd huggingface | ||
| 79 | + git fetch | ||
| 80 | + git pull | ||
| 81 | + echo "pwd: $PWD" | ||
| 82 | + ls -lh ../$m | ||
| 83 | + git lfs track "*.wav" | ||
| 84 | + | ||
| 85 | + rm -rf ./* | ||
| 86 | + | ||
| 87 | + cp -v ../$m/* ./ | ||
| 88 | + | ||
| 89 | + git lfs track "*.onnx" | ||
| 90 | + git add . | ||
| 91 | + | ||
| 92 | + ls -lh | ||
| 93 | + | ||
| 94 | + git status | ||
| 95 | + | ||
| 96 | + git commit -m "add models" | ||
| 97 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/$m main || true | ||
| 98 | + | ||
| 99 | + cd .. | ||
| 100 | + | ||
| 101 | + - name: Release | ||
| 102 | + uses: svenstaro/upload-release-action@v2 | ||
| 103 | + with: | ||
| 104 | + file_glob: true | ||
| 105 | + file: ./*.tar.bz2 | ||
| 106 | + overwrite: true | ||
| 107 | + repo_name: k2-fsa/sherpa-onnx | ||
| 108 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 109 | + tag: asr-models |
| @@ -16,8 +16,9 @@ jobs: | @@ -16,8 +16,9 @@ jobs: | ||
| 16 | fail-fast: false | 16 | fail-fast: false |
| 17 | matrix: | 17 | matrix: |
| 18 | os: [macos-latest] | 18 | os: [macos-latest] |
| 19 | - model: ["turbo", "distil-medium.en", "distil-small.en", "tiny.en", "base.en", "small.en", "medium.en", "tiny", "base", "small", "medium", "medium-aishell", "large", "large-v1", "large-v2", "large-v3", "distil-large-v2"] | 19 | + model: ["turbo", "distil-medium.en", "distil-small.en", "tiny.en", "base.en", "small.en", "medium.en", "tiny", "base", "small", "medium", "medium-aishell", "large", "large-v1", "large-v2", "large-v3", "distil-large-v2", "distil-large-v3", "distil-large-v3.5"] |
| 20 | # model: ["large", "large-v1", "large-v2", "large-v3", "distil-large-v2"] | 20 | # model: ["large", "large-v1", "large-v2", "large-v3", "distil-large-v2"] |
| 21 | + # model: ["distil-large-v3.5", "distil-large-v3"] | ||
| 21 | python-version: ["3.8"] | 22 | python-version: ["3.8"] |
| 22 | 23 | ||
| 23 | steps: | 24 | steps: |
| @@ -47,6 +48,12 @@ jobs: | @@ -47,6 +48,12 @@ jobs: | ||
| 47 | elif [[ $model == distil-large-v2 ]]; then | 48 | elif [[ $model == distil-large-v2 ]]; then |
| 48 | wget -q -O distil-large-v2-original-model.bin https://huggingface.co/distil-whisper/distil-large-v2/resolve/main/original-model.bin | 49 | wget -q -O distil-large-v2-original-model.bin https://huggingface.co/distil-whisper/distil-large-v2/resolve/main/original-model.bin |
| 49 | ls -lh | 50 | ls -lh |
| 51 | + elif [[ $model == distil-large-v3 ]]; then | ||
| 52 | + wget -q -O distil-large-v3-original-model.bin https://huggingface.co/distil-whisper/distil-large-v3-openai/resolve/main/model.bin | ||
| 53 | + ls -lh | ||
| 54 | + elif [[ $model == distil-large-v3.5 ]]; then | ||
| 55 | + wget -q -O distil-large-v3.5-original-model.bin https://huggingface.co/distil-whisper/distil-large-v3.5-openai/resolve/main/model.bin | ||
| 56 | + ls -lh | ||
| 50 | elif [[ $model == distil-small.en ]]; then | 57 | elif [[ $model == distil-small.en ]]; then |
| 51 | wget -q -O distil-small-en-original-model.bin https://huggingface.co/distil-whisper/distil-small.en/resolve/main/original-model.bin | 58 | wget -q -O distil-small-en-original-model.bin https://huggingface.co/distil-whisper/distil-small.en/resolve/main/original-model.bin |
| 52 | ls -lh | 59 | ls -lh |
| @@ -155,6 +162,7 @@ jobs: | @@ -155,6 +162,7 @@ jobs: | ||
| 155 | 162 | ||
| 156 | git status | 163 | git status |
| 157 | ls -lh | 164 | ls -lh |
| 165 | + git lfs track "*.wav*" | ||
| 158 | git lfs track "*onnx*" | 166 | git lfs track "*onnx*" |
| 159 | git lfs track "*weights*" | 167 | git lfs track "*weights*" |
| 160 | 168 |
.github/workflows/generate-tts-samples.yaml
0 → 100644
| 1 | +name: generate-tts-samples | ||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + push: | ||
| 5 | + branches: | ||
| 6 | + - tts-samples-2 | ||
| 7 | + | ||
| 8 | + workflow_dispatch: | ||
| 9 | + | ||
| 10 | +concurrency: | ||
| 11 | + group: generate-tts-samples-${{ github.ref }} | ||
| 12 | + cancel-in-progress: true | ||
| 13 | + | ||
| 14 | +jobs: | ||
| 15 | + generate_tts_samples: | ||
| 16 | + name: ${{ matrix.os }} | ||
| 17 | + runs-on: ${{ matrix.os }} | ||
| 18 | + strategy: | ||
| 19 | + fail-fast: false | ||
| 20 | + matrix: | ||
| 21 | + os: [ubuntu-latest] | ||
| 22 | + python-version: ["3.10"] | ||
| 23 | + | ||
| 24 | + steps: | ||
| 25 | + - uses: actions/checkout@v4 | ||
| 26 | + with: | ||
| 27 | + fetch-depth: 0 | ||
| 28 | + | ||
| 29 | + - name: Install Python dependencies | ||
| 30 | + shell: bash | ||
| 31 | + run: | | ||
| 32 | + pip install "numpy<=1.26.4" sherpa-onnx soundfile | ||
| 33 | + | ||
| 34 | + - name: kitten | ||
| 35 | + if: true | ||
| 36 | + shell: bash | ||
| 37 | + env: | ||
| 38 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 39 | + run: | | ||
| 40 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 41 | + git config --global user.name "Fangjun Kuang" | ||
| 42 | + | ||
| 43 | + cd scripts/kitten-tts | ||
| 44 | + pwd=$PWD | ||
| 45 | + | ||
| 46 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 47 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 48 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-tts-samples hf | ||
| 49 | + mkdir -p ./hf/kitten/v0.1-nano/mp3 | ||
| 50 | + mkdir -p ./hf/kitten/v0.2-nano/mp3 | ||
| 51 | + mkdir -p ./hf/kitten/v0.1-mini/mp3 | ||
| 52 | + | ||
| 53 | + for v in 1 2; do | ||
| 54 | + pushd nano_v0_$v | ||
| 55 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_$v-fp16.tar.bz2 | ||
| 56 | + tar xf kitten-nano-en-v0_$v-fp16.tar.bz2 | ||
| 57 | + rm kitten-nano-en-v0_$v-fp16.tar.bz2 | ||
| 58 | + | ||
| 59 | + ln -s ../hf . | ||
| 60 | + python3 ./generate_samples.py | ||
| 61 | + rm -rf kitten-nano-en-v0_$v-fp16 | ||
| 62 | + popd | ||
| 63 | + done | ||
| 64 | + | ||
| 65 | + for v in 1; do | ||
| 66 | + pushd mini_v0_$v | ||
| 67 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-mini-en-v0_$v-fp16.tar.bz2 | ||
| 68 | + tar xf kitten-mini-en-v0_$v-fp16.tar.bz2 | ||
| 69 | + rm kitten-mini-en-v0_$v-fp16.tar.bz2 | ||
| 70 | + | ||
| 71 | + ln -s ../hf . | ||
| 72 | + python3 ./generate_samples.py | ||
| 73 | + rm -rf kitten-mini-en-v0_$v-fp16 | ||
| 74 | + popd | ||
| 75 | + done | ||
| 76 | + | ||
| 77 | + pushd hf | ||
| 78 | + git pull | ||
| 79 | + git add . | ||
| 80 | + git commit -m 'add kitten tts samples' | ||
| 81 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-tts-samples main | ||
| 82 | + popd | ||
| 83 | + rm -rf hf | ||
| 84 | + | ||
| 85 | + - name: matcha en (ljspeech) | ||
| 86 | + if: false | ||
| 87 | + shell: bash | ||
| 88 | + env: | ||
| 89 | + HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| 90 | + run: | | ||
| 91 | + git config --global user.email "csukuangfj@gmail.com" | ||
| 92 | + git config --global user.name "Fangjun Kuang" | ||
| 93 | + | ||
| 94 | + cd scripts/matcha-tts/en/ | ||
| 95 | + pwd=$PWD | ||
| 96 | + | ||
| 97 | + export GIT_LFS_SKIP_SMUDGE=1 | ||
| 98 | + export GIT_CLONE_PROTECTION_ACTIVE=false | ||
| 99 | + git clone https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-tts-samples hf | ||
| 100 | + | ||
| 101 | + mkdir -p ./hf/matcha/icefall-en-ljspeech/mp3 | ||
| 102 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/matcha-icefall-en_US-ljspeech.tar.bz2 | ||
| 103 | + tar xvf matcha-icefall-en_US-ljspeech.tar.bz2 | ||
| 104 | + rm matcha-icefall-en_US-ljspeech.tar.bz2 | ||
| 105 | + | ||
| 106 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/vocoder-models/vocos-22khz-univ.onnx | ||
| 107 | + | ||
| 108 | + python3 ./generate_samples.py | ||
| 109 | + | ||
| 110 | + pushd hf | ||
| 111 | + git pull | ||
| 112 | + git add . | ||
| 113 | + git commit -m 'add matcha tts en (ljspeech) samples' | ||
| 114 | + git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-tts-samples main | ||
| 115 | + popd | ||
| 116 | + | ||
| 117 | + rm -rf hf |
.github/workflows/jar.yaml
0 → 100644
| 1 | +name: jar | ||
| 2 | + | ||
| 3 | +on: | ||
| 4 | + push: | ||
| 5 | + branches: | ||
| 6 | + - refactor-jar | ||
| 7 | + tags: | ||
| 8 | + - 'v[0-9]+.[0-9]+.[0-9]+*' | ||
| 9 | + | ||
| 10 | + workflow_dispatch: | ||
| 11 | + | ||
| 12 | +concurrency: | ||
| 13 | + group: jar-${{ github.ref }} | ||
| 14 | + cancel-in-progress: true | ||
| 15 | + | ||
| 16 | +permissions: | ||
| 17 | + contents: write | ||
| 18 | +jobs: | ||
| 19 | + jar: | ||
| 20 | + runs-on: ${{ matrix.os }} | ||
| 21 | + name: ${{ matrix.os }} ${{ matrix.arch }} | ||
| 22 | + strategy: | ||
| 23 | + fail-fast: false | ||
| 24 | + matrix: | ||
| 25 | + include: | ||
| 26 | + - os: ubuntu-24.04-arm | ||
| 27 | + arch: "arm64" | ||
| 28 | + | ||
| 29 | + - os: ubuntu-latest | ||
| 30 | + arch: "x64" | ||
| 31 | + | ||
| 32 | + - os: macos-latest | ||
| 33 | + arch: "arm64" | ||
| 34 | + | ||
| 35 | + - os: macos-13 | ||
| 36 | + arch: "x64" | ||
| 37 | + | ||
| 38 | + - os: windows-latest | ||
| 39 | + arch: "x64" | ||
| 40 | + | ||
| 41 | + steps: | ||
| 42 | + - uses: actions/checkout@v4 | ||
| 43 | + with: | ||
| 44 | + fetch-depth: 0 | ||
| 45 | + | ||
| 46 | + - uses: actions/setup-java@v4 | ||
| 47 | + with: | ||
| 48 | + distribution: 'temurin' # See 'Supported distributions' for available options | ||
| 49 | + java-version: '21' | ||
| 50 | + | ||
| 51 | + - name: Show java version | ||
| 52 | + shell: bash | ||
| 53 | + run: | | ||
| 54 | + java --version | ||
| 55 | + | ||
| 56 | + - name: Download libs ${{ matrix.os }} ${{ matrix.arch }} | ||
| 57 | + if: ${{ matrix.os == 'ubuntu-24.04-arm' && matrix.arch == 'arm64' }} | ||
| 58 | + shell: bash | ||
| 59 | + run: | | ||
| 60 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 61 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/v$SHERPA_ONNX_VERSION/sherpa-onnx-v$SHERPA_ONNX_VERSION-linux-aarch64-jni.tar.bz2 | ||
| 62 | + tar xvf ./*.tar.bz2 | ||
| 63 | + | ||
| 64 | + src=sherpa-onnx-v$SHERPA_ONNX_VERSION-linux-aarch64-jni | ||
| 65 | + dst=sherpa-onnx/java-api/resources/sherpa-onnx/native/linux-aarch64 | ||
| 66 | + | ||
| 67 | + mkdir -p $dst | ||
| 68 | + cp -v $src/lib/libsherpa-onnx-jni.so $dst/ | ||
| 69 | + cp -v $src/lib/libonnxruntime.so $dst/ | ||
| 70 | + | ||
| 71 | + ls -lh $dst | ||
| 72 | + rm -rf $src* | ||
| 73 | + | ||
| 74 | + - name: Download libs ${{ matrix.os }} ${{ matrix.arch }} | ||
| 75 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' }} | ||
| 76 | + shell: bash | ||
| 77 | + run: | | ||
| 78 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 79 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/v$SHERPA_ONNX_VERSION/sherpa-onnx-v$SHERPA_ONNX_VERSION-linux-x64-jni.tar.bz2 | ||
| 80 | + tar xvf ./*.tar.bz2 | ||
| 81 | + | ||
| 82 | + src=sherpa-onnx-v$SHERPA_ONNX_VERSION-linux-x64-jni | ||
| 83 | + dst=sherpa-onnx/java-api/resources/sherpa-onnx/native/linux-x64 | ||
| 84 | + | ||
| 85 | + mkdir -p $dst | ||
| 86 | + cp -v $src/lib/libsherpa-onnx-jni.so $dst/ | ||
| 87 | + cp -v $src/lib/libonnxruntime.so $dst/ | ||
| 88 | + | ||
| 89 | + ls -lh $dst | ||
| 90 | + rm -rf $src* | ||
| 91 | + | ||
| 92 | + - name: Download libs ${{ matrix.os }} ${{ matrix.arch }} | ||
| 93 | + if: ${{ matrix.os == 'macos-latest' && matrix.arch == 'arm64' }} | ||
| 94 | + shell: bash | ||
| 95 | + run: | | ||
| 96 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 97 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/v$SHERPA_ONNX_VERSION/sherpa-onnx-v$SHERPA_ONNX_VERSION-osx-arm64-jni.tar.bz2 | ||
| 98 | + tar xvf ./*.tar.bz2 | ||
| 99 | + | ||
| 100 | + src=sherpa-onnx-v$SHERPA_ONNX_VERSION-osx-arm64-jni | ||
| 101 | + dst=sherpa-onnx/java-api/resources/sherpa-onnx/native/osx-aarch64 | ||
| 102 | + | ||
| 103 | + mkdir -p $dst | ||
| 104 | + cp -v $src/lib/libonnxruntime.1.17.1.dylib $dst/ | ||
| 105 | + cp -v $src/lib/libsherpa-onnx-jni.dylib $dst/ | ||
| 106 | + | ||
| 107 | + ls -lh $dst | ||
| 108 | + rm -rf $src* | ||
| 109 | + | ||
| 110 | + - name: Download libs ${{ matrix.os }} ${{ matrix.arch }} | ||
| 111 | + if: ${{ matrix.os == 'macos-13' && matrix.arch == 'x64' }} | ||
| 112 | + shell: bash | ||
| 113 | + run: | | ||
| 114 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 115 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/v$SHERPA_ONNX_VERSION/sherpa-onnx-v$SHERPA_ONNX_VERSION-osx-x86_64-jni.tar.bz2 | ||
| 116 | + tar xvf ./*.tar.bz2 | ||
| 117 | + | ||
| 118 | + src=sherpa-onnx-v$SHERPA_ONNX_VERSION-osx-x86_64-jni | ||
| 119 | + dst=sherpa-onnx/java-api/resources/sherpa-onnx/native/osx-x64 | ||
| 120 | + | ||
| 121 | + mkdir -p $dst | ||
| 122 | + cp -v $src/lib/libonnxruntime.1.17.1.dylib $dst/ | ||
| 123 | + cp -v $src/lib/libsherpa-onnx-jni.dylib $dst/ | ||
| 124 | + | ||
| 125 | + ls -lh $dst | ||
| 126 | + rm -rf $src* | ||
| 127 | + | ||
| 128 | + - name: Download libs ${{ matrix.os }} ${{ matrix.arch }} | ||
| 129 | + if: ${{ matrix.os == 'windows-latest' && matrix.arch == 'x64' }} | ||
| 130 | + shell: bash | ||
| 131 | + run: | | ||
| 132 | + SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 133 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/v$SHERPA_ONNX_VERSION/sherpa-onnx-v$SHERPA_ONNX_VERSION-win-x64-jni.tar.bz2 | ||
| 134 | + tar xvf ./*.tar.bz2 | ||
| 135 | + | ||
| 136 | + src=sherpa-onnx-v$SHERPA_ONNX_VERSION-win-x64-jni | ||
| 137 | + ls -lh $src | ||
| 138 | + ls -lh $src/lib | ||
| 139 | + dst=sherpa-onnx/java-api/resources/sherpa-onnx/native/win-x64 | ||
| 140 | + | ||
| 141 | + mkdir -p $dst | ||
| 142 | + cp -v $src/lib/onnxruntime.dll $dst/ | ||
| 143 | + cp -v $src/lib/sherpa-onnx-jni.dll $dst/ | ||
| 144 | + | ||
| 145 | + ls -lh $dst | ||
| 146 | + rm -rf $src* | ||
| 147 | + | ||
| 148 | + - name: Create java jar (source code) | ||
| 149 | + shell: bash | ||
| 150 | + run: | | ||
| 151 | + cd sherpa-onnx/java-api | ||
| 152 | + make | ||
| 153 | + | ||
| 154 | + ls -lh build | ||
| 155 | + | ||
| 156 | + - name: Create java jar (native lib) | ||
| 157 | + shell: bash | ||
| 158 | + run: | | ||
| 159 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 160 | + | ||
| 161 | + cd sherpa-onnx/java-api | ||
| 162 | + | ||
| 163 | + ls -lh resources/sherpa-onnx/native | ||
| 164 | + | ||
| 165 | + echo "--" | ||
| 166 | + | ||
| 167 | + ls -lh resources/sherpa-onnx/native/*/ | ||
| 168 | + | ||
| 169 | + jar cfvm ./sherpa-onnx-native.jar MANIFEST.MF -C ./resources . | ||
| 170 | + | ||
| 171 | + ls -lh *.jar | ||
| 172 | + | ||
| 173 | + os=${{ matrix.os }} | ||
| 174 | + arch=${{ matrix.arch }} | ||
| 175 | + | ||
| 176 | + if [[ $os == "ubuntu-24.04-arm" && $arch == "arm64" ]]; then | ||
| 177 | + mv -v sherpa-onnx-native.jar sherpa-onnx-native-lib-linux-aarch64-$SHERPA_ONNX_VERSION.jar | ||
| 178 | + elif [[ $os == "ubuntu-latest" && $arch == "x64" ]]; then | ||
| 179 | + mv -v sherpa-onnx-native.jar sherpa-onnx-native-lib-linux-x64-$SHERPA_ONNX_VERSION.jar | ||
| 180 | + elif [[ $os == "macos-latest" && $arch == "arm64" ]]; then | ||
| 181 | + mv -v sherpa-onnx-native.jar sherpa-onnx-native-lib-osx-aarch64-$SHERPA_ONNX_VERSION.jar | ||
| 182 | + elif [[ $os == "macos-13" && $arch == "x64" ]]; then | ||
| 183 | + mv -v sherpa-onnx-native.jar sherpa-onnx-native-lib-osx-x64-$SHERPA_ONNX_VERSION.jar | ||
| 184 | + elif [[ $os == "windows-latest" && $arch == "x64" ]]; then | ||
| 185 | + mv -v sherpa-onnx-native.jar sherpa-onnx-native-lib-win-x64-$SHERPA_ONNX_VERSION.jar | ||
| 186 | + else | ||
| 187 | + echo "Unknown os $os with arch $arch" | ||
| 188 | + fi | ||
| 189 | + | ||
| 190 | + - name: Show java jar (source code) | ||
| 191 | + shell: bash | ||
| 192 | + run: | | ||
| 193 | + cd sherpa-onnx/java-api | ||
| 194 | + | ||
| 195 | + unzip -l build/sherpa-onnx.jar | ||
| 196 | + | ||
| 197 | + - name: Show java jar (native lib) | ||
| 198 | + shell: bash | ||
| 199 | + run: | | ||
| 200 | + cd sherpa-onnx/java-api | ||
| 201 | + | ||
| 202 | + unzip -l sherpa-onnx*.jar | ||
| 203 | + | ||
| 204 | + - name: Release jar | ||
| 205 | + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 206 | + uses: svenstaro/upload-release-action@v2 | ||
| 207 | + with: | ||
| 208 | + file_glob: true | ||
| 209 | + overwrite: true | ||
| 210 | + file: ./sherpa-onnx/java-api/sherpa-onnx-native-*.jar | ||
| 211 | + | ||
| 212 | + - name: Release jar | ||
| 213 | + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 214 | + uses: svenstaro/upload-release-action@v2 | ||
| 215 | + with: | ||
| 216 | + file_glob: true | ||
| 217 | + overwrite: true | ||
| 218 | + file: ./sherpa-onnx/java-api/sherpa-onnx-native-*.jar | ||
| 219 | + repo_name: k2-fsa/sherpa-onnx | ||
| 220 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 221 | + tag: v1.12.10 | ||
| 222 | + | ||
| 223 | + - name: Test KittenTTS | ||
| 224 | + shell: bash | ||
| 225 | + run: | | ||
| 226 | + SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 227 | + | ||
| 228 | + os=${{ matrix.os }} | ||
| 229 | + arch=${{ matrix.arch }} | ||
| 230 | + | ||
| 231 | + if [[ $os == "ubuntu-24.04-arm" && $arch == "arm64" ]]; then | ||
| 232 | + native_jar=sherpa-onnx-native-lib-linux-aarch64-$SHERPA_ONNX_VERSION.jar | ||
| 233 | + elif [[ $os == "ubuntu-latest" && $arch == "x64" ]]; then | ||
| 234 | + native_jar=sherpa-onnx-native-lib-linux-x64-$SHERPA_ONNX_VERSION.jar | ||
| 235 | + elif [[ $os == "macos-latest" && $arch == "arm64" ]]; then | ||
| 236 | + native_jar=sherpa-onnx-native-lib-osx-aarch64-$SHERPA_ONNX_VERSION.jar | ||
| 237 | + elif [[ $os == "macos-13" && $arch == "x64" ]]; then | ||
| 238 | + native_jar=sherpa-onnx-native-lib-osx-x64-$SHERPA_ONNX_VERSION.jar | ||
| 239 | + elif [[ $os == "windows-latest" && $arch == "x64" ]]; then | ||
| 240 | + native_jar=sherpa-onnx-native-lib-win-x64-$SHERPA_ONNX_VERSION.jar | ||
| 241 | + else | ||
| 242 | + echo "Unknown os $os with arch $arch" | ||
| 243 | + fi | ||
| 244 | + | ||
| 245 | + echo "native_jar: $native_jar" | ||
| 246 | + ls -lh sherpa-onnx/java-api/$native_jar | ||
| 247 | + | ||
| 248 | + if [[ ${{ matrix.os }} == "windows-latest" ]]; then | ||
| 249 | + SEP=";" | ||
| 250 | + else | ||
| 251 | + SEP=":" | ||
| 252 | + fi | ||
| 253 | + cd java-api-examples | ||
| 254 | + | ||
| 255 | + curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/kitten-nano-en-v0_1-fp16.tar.bz2 | ||
| 256 | + tar xf kitten-nano-en-v0_1-fp16.tar.bz2 | ||
| 257 | + rm kitten-nano-en-v0_1-fp16.tar.bz2 | ||
| 258 | + | ||
| 259 | + java \ | ||
| 260 | + -cp "../sherpa-onnx/java-api/build/sherpa-onnx.jar${SEP}../sherpa-onnx/java-api/$native_jar" \ | ||
| 261 | + NonStreamingTtsKittenEn.java |
| @@ -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 | ||
| @@ -43,13 +28,14 @@ concurrency: | @@ -43,13 +28,14 @@ concurrency: | ||
| 43 | jobs: | 28 | jobs: |
| 44 | linux_gpu: | 29 | linux_gpu: |
| 45 | runs-on: ${{ matrix.os }} | 30 | runs-on: ${{ matrix.os }} |
| 46 | - name: ${{ matrix.build_type }} | 31 | + name: ${{ matrix.build_type }} ${{ matrix.onnxruntime_version }} |
| 47 | strategy: | 32 | strategy: |
| 48 | fail-fast: false | 33 | fail-fast: false |
| 49 | matrix: | 34 | matrix: |
| 50 | os: [ubuntu-latest] | 35 | os: [ubuntu-latest] |
| 51 | # build_type: [Release, Debug] | 36 | # build_type: [Release, Debug] |
| 52 | build_type: [Release] | 37 | build_type: [Release] |
| 38 | + onnxruntime_version: ["1.17.1", "1.22.0"] | ||
| 53 | 39 | ||
| 54 | steps: | 40 | steps: |
| 55 | - uses: actions/checkout@v4 | 41 | - uses: actions/checkout@v4 |
| @@ -79,6 +65,17 @@ jobs: | @@ -79,6 +65,17 @@ jobs: | ||
| 79 | 65 | ||
| 80 | cd /home/runner/work/sherpa-onnx/sherpa-onnx | 66 | cd /home/runner/work/sherpa-onnx/sherpa-onnx |
| 81 | 67 | ||
| 68 | + onnxruntime_version=${{ matrix.onnxruntime_version }} | ||
| 69 | + if [[ $onnxruntime_version == "1.22.0" ]]; then | ||
| 70 | + curl -SL -O https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.22.0/onnxruntime-linux-x64-gpu-1.22.0-patched.zip | ||
| 71 | + unzip onnxruntime-linux-x64-gpu-1.22.0-patched.zip | ||
| 72 | + | ||
| 73 | + export SHERPA_ONNXRUNTIME_LIB_DIR=$PWD/onnxruntime-linux-x64-gpu-1.22.0-patched/lib | ||
| 74 | + export SHERPA_ONNXRUNTIME_INCLUDE_DIR=$PWD/onnxruntime-linux-x64-gpu-1.22.0-patched/include | ||
| 75 | + | ||
| 76 | + ls -lh /home/runner/work/sherpa-onnx/sherpa-onnx/onnxruntime-linux-x64-gpu-1.22.0-patched/lib/libonnxruntime.so | ||
| 77 | + fi | ||
| 78 | + | ||
| 82 | git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib | 79 | git clone --depth 1 --branch v1.2.12 https://github.com/alsa-project/alsa-lib |
| 83 | pushd alsa-lib | 80 | pushd alsa-lib |
| 84 | ./gitcompile | 81 | ./gitcompile |
| @@ -115,7 +112,7 @@ jobs: | @@ -115,7 +112,7 @@ jobs: | ||
| 115 | du -h -d1 . | 112 | du -h -d1 . |
| 116 | sudo chown -R $USER ./build | 113 | sudo chown -R $USER ./build |
| 117 | ls -lh build/bin | 114 | ls -lh build/bin |
| 118 | - ls -lh build/_deps/onnxruntime-src/lib/ | 115 | + ls -lh build/_deps/onnxruntime-src/lib/ || true |
| 119 | 116 | ||
| 120 | echo "strip" | 117 | echo "strip" |
| 121 | strip build/bin/* | 118 | strip build/bin/* |
| @@ -135,12 +132,17 @@ jobs: | @@ -135,12 +132,17 @@ jobs: | ||
| 135 | strings build/install/lib/*.so | grep "^GLIBC_" | 132 | strings build/install/lib/*.so | grep "^GLIBC_" |
| 136 | 133 | ||
| 137 | - name: Copy files | 134 | - name: Copy files |
| 138 | - if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 139 | shell: bash | 135 | shell: bash |
| 140 | run: | | 136 | run: | |
| 141 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 137 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| 142 | 138 | ||
| 143 | dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64-gpu | 139 | dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-linux-x64-gpu |
| 140 | + | ||
| 141 | + onnxruntime_version=${{ matrix.onnxruntime_version }} | ||
| 142 | + if [[ $onnxruntime_version == "1.22.0" ]]; then | ||
| 143 | + dst=sherpa-onnx-${SHERPA_ONNX_VERSION}-cuda-12.x-cudnn-9.x-linux-x64-gpu | ||
| 144 | + fi | ||
| 145 | + | ||
| 144 | mkdir $dst | 146 | mkdir $dst |
| 145 | 147 | ||
| 146 | cp -a build/install/bin $dst/ | 148 | cp -a build/install/bin $dst/ |
| @@ -152,15 +154,23 @@ jobs: | @@ -152,15 +154,23 @@ jobs: | ||
| 152 | tar cjvf ${dst}.tar.bz2 $dst | 154 | tar cjvf ${dst}.tar.bz2 $dst |
| 153 | 155 | ||
| 154 | - name: Release pre-compiled binaries and libs for linux x64 | 156 | - name: Release pre-compiled binaries and libs for linux x64 |
| 155 | - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | 157 | + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 158 | + uses: svenstaro/upload-release-action@v2 | ||
| 159 | + with: | ||
| 160 | + file_glob: true | ||
| 161 | + overwrite: true | ||
| 162 | + file: sherpa-onnx-*gpu.tar.bz2 | ||
| 163 | + repo_name: k2-fsa/sherpa-onnx | ||
| 164 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 165 | + tag: v1.12.13 | ||
| 166 | + | ||
| 167 | + - name: Release pre-compiled binaries and libs for linux x64 | ||
| 168 | + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 156 | uses: svenstaro/upload-release-action@v2 | 169 | uses: svenstaro/upload-release-action@v2 |
| 157 | with: | 170 | with: |
| 158 | file_glob: true | 171 | file_glob: true |
| 159 | overwrite: true | 172 | overwrite: true |
| 160 | - file: sherpa-onnx-*linux-x64-gpu.tar.bz2 | ||
| 161 | - # repo_name: k2-fsa/sherpa-onnx | ||
| 162 | - # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 163 | - # tag: v1.11.3 | 173 | + file: sherpa-onnx-*gpu.tar.bz2 |
| 164 | 174 | ||
| 165 | - name: Display dependencies of sherpa-onnx for linux | 175 | - name: Display dependencies of sherpa-onnx for linux |
| 166 | shell: bash | 176 | shell: bash |
| @@ -20,7 +20,7 @@ jobs: | @@ -20,7 +20,7 @@ jobs: | ||
| 20 | fail-fast: false | 20 | fail-fast: false |
| 21 | matrix: | 21 | matrix: |
| 22 | os: [ubuntu-latest] | 22 | os: [ubuntu-latest] |
| 23 | - java-version: ['8', '11', '16', '17', '18', '19', '20', '21', '22', '23', '24'] | 23 | + java-version: ['24'] |
| 24 | 24 | ||
| 25 | steps: | 25 | steps: |
| 26 | - uses: actions/checkout@v4 | 26 | - uses: actions/checkout@v4 |
| @@ -46,7 +46,6 @@ jobs: | @@ -46,7 +46,6 @@ jobs: | ||
| 46 | du -h -d1 . | 46 | du -h -d1 . |
| 47 | 47 | ||
| 48 | - name: Build jar ${{ matrix.java-version }} | 48 | - name: Build jar ${{ matrix.java-version }} |
| 49 | - if: matrix.java-version == '23' | ||
| 50 | shell: bash | 49 | shell: bash |
| 51 | run: | | 50 | run: | |
| 52 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | 51 | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) |
| @@ -57,35 +56,31 @@ jobs: | @@ -57,35 +56,31 @@ jobs: | ||
| 57 | cd ../.. | 56 | cd ../.. |
| 58 | ls -lh *.jar | 57 | ls -lh *.jar |
| 59 | 58 | ||
| 60 | - - name: Build jar ${{ matrix.java-version }} | ||
| 61 | - shell: bash | ||
| 62 | - run: | | ||
| 63 | - SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
| 64 | - cd sherpa-onnx/java-api | ||
| 65 | - make | ||
| 66 | - ls -lh build/ | ||
| 67 | - cp build/sherpa-onnx.jar ../../sherpa-onnx-$SHERPA_ONNX_VERSION-java${{ matrix.java-version }}.jar | ||
| 68 | - cd ../.. | ||
| 69 | - ls -lh *.jar | ||
| 70 | - | ||
| 71 | - uses: actions/upload-artifact@v4 | 59 | - uses: actions/upload-artifact@v4 |
| 72 | with: | 60 | with: |
| 73 | name: release-jni-linux-jar-${{ matrix.java-version }} | 61 | name: release-jni-linux-jar-${{ matrix.java-version }} |
| 74 | path: ./*.jar | 62 | path: ./*.jar |
| 75 | 63 | ||
| 76 | - name: Release jar | 64 | - name: Release jar |
| 77 | - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | 65 | + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 66 | + uses: svenstaro/upload-release-action@v2 | ||
| 67 | + with: | ||
| 68 | + file_glob: true | ||
| 69 | + overwrite: true | ||
| 70 | + file: ./*.jar | ||
| 71 | + repo_name: k2-fsa/sherpa-onnx | ||
| 72 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 73 | + tag: v1.12.11 | ||
| 74 | + | ||
| 75 | + - name: Release jar | ||
| 76 | + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 78 | uses: svenstaro/upload-release-action@v2 | 77 | uses: svenstaro/upload-release-action@v2 |
| 79 | with: | 78 | with: |
| 80 | file_glob: true | 79 | file_glob: true |
| 81 | overwrite: true | 80 | overwrite: true |
| 82 | file: ./*.jar | 81 | file: ./*.jar |
| 83 | - # repo_name: k2-fsa/sherpa-onnx | ||
| 84 | - # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 85 | - # tag: v1.12.1 | ||
| 86 | 82 | ||
| 87 | - name: Build sherpa-onnx | 83 | - name: Build sherpa-onnx |
| 88 | - if: matrix.java-version == '23' | ||
| 89 | uses: addnab/docker-run-action@v3 | 84 | uses: addnab/docker-run-action@v3 |
| 90 | with: | 85 | with: |
| 91 | image: quay.io/pypa/manylinux2014_x86_64 | 86 | image: quay.io/pypa/manylinux2014_x86_64 |
| @@ -151,7 +146,6 @@ jobs: | @@ -151,7 +146,6 @@ jobs: | ||
| 151 | ls -lh install/bin | 146 | ls -lh install/bin |
| 152 | 147 | ||
| 153 | - name: Display dependencies of sherpa-onnx for linux | 148 | - name: Display dependencies of sherpa-onnx for linux |
| 154 | - if: matrix.java-version == '23' | ||
| 155 | shell: bash | 149 | shell: bash |
| 156 | run: | | 150 | run: | |
| 157 | du -h -d1 . | 151 | du -h -d1 . |
| @@ -170,13 +164,11 @@ jobs: | @@ -170,13 +164,11 @@ jobs: | ||
| 170 | readelf -d build/bin/sherpa-onnx | 164 | readelf -d build/bin/sherpa-onnx |
| 171 | 165 | ||
| 172 | - uses: actions/upload-artifact@v4 | 166 | - uses: actions/upload-artifact@v4 |
| 173 | - if: matrix.java-version == '23' | ||
| 174 | with: | 167 | with: |
| 175 | name: release-jni-linux-${{ matrix.java-version }} | 168 | name: release-jni-linux-${{ matrix.java-version }} |
| 176 | path: build/install/* | 169 | path: build/install/* |
| 177 | 170 | ||
| 178 | - name: Copy files | 171 | - name: Copy files |
| 179 | - if: matrix.java-version == '23' | ||
| 180 | shell: bash | 172 | shell: bash |
| 181 | run: | | 173 | run: | |
| 182 | du -h -d1 . | 174 | du -h -d1 . |
| @@ -194,8 +186,27 @@ jobs: | @@ -194,8 +186,27 @@ jobs: | ||
| 194 | tar cjvf ${dst}.tar.bz2 $dst | 186 | tar cjvf ${dst}.tar.bz2 $dst |
| 195 | du -h -d1 . | 187 | du -h -d1 . |
| 196 | 188 | ||
| 189 | + - name: Release pre-compiled binaries and libs for linux x64 | ||
| 190 | + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 191 | + uses: svenstaro/upload-release-action@v2 | ||
| 192 | + with: | ||
| 193 | + file_glob: true | ||
| 194 | + overwrite: true | ||
| 195 | + file: sherpa-onnx-*.tar.bz2 | ||
| 196 | + repo_name: k2-fsa/sherpa-onnx | ||
| 197 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 198 | + tag: v1.12.11 | ||
| 199 | + | ||
| 200 | + - name: Release pre-compiled binaries and libs for linux x64 | ||
| 201 | + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 202 | + uses: svenstaro/upload-release-action@v2 | ||
| 203 | + with: | ||
| 204 | + file_glob: true | ||
| 205 | + overwrite: true | ||
| 206 | + file: sherpa-onnx-*.tar.bz2 | ||
| 207 | + | ||
| 197 | - name: Publish to huggingface | 208 | - name: Publish to huggingface |
| 198 | - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && matrix.java-version == '23' | 209 | + if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') |
| 199 | env: | 210 | env: |
| 200 | HF_TOKEN: ${{ secrets.HF_TOKEN }} | 211 | HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| 201 | uses: nick-fields/retry@v3 | 212 | uses: nick-fields/retry@v3 |
| @@ -215,6 +226,7 @@ jobs: | @@ -215,6 +226,7 @@ jobs: | ||
| 215 | cd huggingface | 226 | cd huggingface |
| 216 | dst=jni/$SHERPA_ONNX_VERSION | 227 | dst=jni/$SHERPA_ONNX_VERSION |
| 217 | mkdir -p $dst | 228 | mkdir -p $dst |
| 229 | + git lfs track "*.jar" | ||
| 218 | 230 | ||
| 219 | cp -v ../sherpa-onnx-*.tar.bz2 $dst/ | 231 | cp -v ../sherpa-onnx-*.tar.bz2 $dst/ |
| 220 | cp -v ../*.jar $dst/ | 232 | cp -v ../*.jar $dst/ |
| @@ -227,14 +239,3 @@ jobs: | @@ -227,14 +239,3 @@ jobs: | ||
| 227 | git commit -m "add more files" | 239 | git commit -m "add more files" |
| 228 | 240 | ||
| 229 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main | 241 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main |
| 230 | - | ||
| 231 | - - name: Release pre-compiled binaries and libs for linux x64 | ||
| 232 | - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') && matrix.java-version == '23' | ||
| 233 | - uses: svenstaro/upload-release-action@v2 | ||
| 234 | - with: | ||
| 235 | - file_glob: true | ||
| 236 | - overwrite: true | ||
| 237 | - file: sherpa-onnx-*.tar.bz2 | ||
| 238 | - # repo_name: k2-fsa/sherpa-onnx | ||
| 239 | - # repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 240 | - # tag: v1.12.0 |
| @@ -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 | ||
| @@ -136,6 +126,43 @@ jobs: | @@ -136,6 +126,43 @@ jobs: | ||
| 136 | cp -v ../sherpa-onnx/pascal-api/*.pas ../pascal-api-examples/vad-with-non-streaming-asr | 126 | cp -v ../sherpa-onnx/pascal-api/*.pas ../pascal-api-examples/vad-with-non-streaming-asr |
| 137 | fi | 127 | fi |
| 138 | 128 | ||
| 129 | + - name: Run Pascal test (Streaming ASR) | ||
| 130 | + shell: bash | ||
| 131 | + run: | | ||
| 132 | + export PATH=/c/lazarus/fpc/3.2.2/bin/x86_64-win64:$PATH | ||
| 133 | + | ||
| 134 | + cd ./pascal-api-examples | ||
| 135 | + | ||
| 136 | + pushd streaming-asr | ||
| 137 | + | ||
| 138 | + ./run-t-one-ctc.sh | ||
| 139 | + rm -rf sherpa-onnx-* | ||
| 140 | + echo "---" | ||
| 141 | + | ||
| 142 | + ./run-zipformer-transducer.sh | ||
| 143 | + rm -rf sherpa-onnx-* | ||
| 144 | + echo "---" | ||
| 145 | + | ||
| 146 | + ./run-nemo-transducer.sh | ||
| 147 | + rm -rf sherpa-onnx-* | ||
| 148 | + echo "---" | ||
| 149 | + | ||
| 150 | + if [[ ${{ matrix.os }} != 'windows-latest' ]]; then | ||
| 151 | + ./run-paraformer.sh | ||
| 152 | + rm -rf sherpa-onnx-* | ||
| 153 | + echo "---" | ||
| 154 | + | ||
| 155 | + ./run-zipformer-ctc.sh | ||
| 156 | + echo "---" | ||
| 157 | + | ||
| 158 | + ./run-zipformer-ctc-hlg.sh | ||
| 159 | + rm -rf sherpa-onnx-* | ||
| 160 | + echo "---" | ||
| 161 | + fi | ||
| 162 | + | ||
| 163 | + ls -lh | ||
| 164 | + popd | ||
| 165 | + | ||
| 139 | - name: Run Pascal test (VAD test) | 166 | - name: Run Pascal test (VAD test) |
| 140 | shell: bash | 167 | shell: bash |
| 141 | run: | | 168 | run: | |
| @@ -331,36 +358,3 @@ jobs: | @@ -331,36 +358,3 @@ jobs: | ||
| 331 | echo "---" | 358 | echo "---" |
| 332 | ls -lh | 359 | ls -lh |
| 333 | popd | 360 | popd |
| 334 | - | ||
| 335 | - - name: Run Pascal test (Streaming ASR) | ||
| 336 | - shell: bash | ||
| 337 | - run: | | ||
| 338 | - export PATH=/c/lazarus/fpc/3.2.2/bin/x86_64-win64:$PATH | ||
| 339 | - | ||
| 340 | - cd ./pascal-api-examples | ||
| 341 | - | ||
| 342 | - pushd streaming-asr | ||
| 343 | - | ||
| 344 | - ./run-zipformer-transducer.sh | ||
| 345 | - rm -rf sherpa-onnx-* | ||
| 346 | - echo "---" | ||
| 347 | - | ||
| 348 | - ./run-nemo-transducer.sh | ||
| 349 | - rm -rf sherpa-onnx-* | ||
| 350 | - echo "---" | ||
| 351 | - | ||
| 352 | - if [[ ${{ matrix.os }} != 'windows-latest' ]]; then | ||
| 353 | - ./run-paraformer.sh | ||
| 354 | - rm -rf sherpa-onnx-* | ||
| 355 | - echo "---" | ||
| 356 | - | ||
| 357 | - ./run-zipformer-ctc.sh | ||
| 358 | - echo "---" | ||
| 359 | - | ||
| 360 | - ./run-zipformer-ctc-hlg.sh | ||
| 361 | - rm -rf sherpa-onnx-* | ||
| 362 | - echo "---" | ||
| 363 | - fi | ||
| 364 | - | ||
| 365 | - ls -lh | ||
| 366 | - popd |
| @@ -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 | ||
| @@ -137,66 +127,6 @@ jobs: | @@ -137,66 +127,6 @@ jobs: | ||
| 137 | 127 | ||
| 138 | readelf -d build-riscv64-linux-gnu/bin/sherpa-onnx | 128 | readelf -d build-riscv64-linux-gnu/bin/sherpa-onnx |
| 139 | 129 | ||
| 140 | - - name: Test sherpa-onnx | ||
| 141 | - shell: bash | ||
| 142 | - run: | | ||
| 143 | - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH | ||
| 144 | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | ||
| 145 | - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot | ||
| 146 | - export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/toolchain/sysroot/lib | ||
| 147 | - | ||
| 148 | - ls -lh ./build-riscv64-linux-gnu/bin | ||
| 149 | - | ||
| 150 | - echo "----------sherpa-onnx----------" | ||
| 151 | - qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx --help | ||
| 152 | - readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx | ||
| 153 | - | ||
| 154 | - echo "----------sherpa-onnx-offline----------" | ||
| 155 | - qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline --help | ||
| 156 | - readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline | ||
| 157 | - | ||
| 158 | - echo "----------sherpa-onnx-offline-tts----------" | ||
| 159 | - qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts --help | ||
| 160 | - readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts | ||
| 161 | - | ||
| 162 | - - name: Test streaming speech recognition | ||
| 163 | - shell: bash | ||
| 164 | - run: | | ||
| 165 | - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH | ||
| 166 | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | ||
| 167 | - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot | ||
| 168 | - export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/toolchain/sysroot/lib | ||
| 169 | - | ||
| 170 | - wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2 | ||
| 171 | - tar xvf sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2 | ||
| 172 | - rm sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2 | ||
| 173 | - | ||
| 174 | - qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx \ | ||
| 175 | - --tokens=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/tokens.txt \ | ||
| 176 | - --encoder=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/encoder-epoch-99-avg-1.onnx \ | ||
| 177 | - --decoder=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/decoder-epoch-99-avg-1.onnx \ | ||
| 178 | - --joiner=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/joiner-epoch-99-avg-1.onnx \ | ||
| 179 | - ./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/test_wavs/0.wav | ||
| 180 | - | ||
| 181 | - - name: Test offline tts | ||
| 182 | - shell: bash | ||
| 183 | - run: | | ||
| 184 | - export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH | ||
| 185 | - export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | ||
| 186 | - export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot | ||
| 187 | - export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/toolchain/sysroot/lib | ||
| 188 | - | ||
| 189 | - wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-lessac-medium.tar.bz2 | ||
| 190 | - tar xf vits-piper-en_US-lessac-medium.tar.bz2 | ||
| 191 | - rm vits-piper-en_US-lessac-medium.tar.bz2 | ||
| 192 | - | ||
| 193 | - qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts \ | ||
| 194 | - --vits-model=./vits-piper-en_US-lessac-medium/en_US-lessac-medium.onnx \ | ||
| 195 | - --vits-data-dir=./vits-piper-en_US-lessac-medium/espeak-ng-data \ | ||
| 196 | - --vits-tokens=./vits-piper-en_US-lessac-medium/tokens.txt \ | ||
| 197 | - --output-filename=./liliana-piper-en_US-lessac-medium.wav \ | ||
| 198 | - 'liliana, the most beautiful and lovely assistant of our team!' | ||
| 199 | - | ||
| 200 | - name: Copy files | 130 | - name: Copy files |
| 201 | shell: bash | 131 | shell: bash |
| 202 | run: | | 132 | run: | |
| @@ -270,21 +200,92 @@ jobs: | @@ -270,21 +200,92 @@ jobs: | ||
| 270 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main | 200 | git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main |
| 271 | 201 | ||
| 272 | - uses: actions/upload-artifact@v4 | 202 | - uses: actions/upload-artifact@v4 |
| 273 | - if: matrix.lib_type == 'shared' | ||
| 274 | - with: | ||
| 275 | - name: wave | ||
| 276 | - path: ./*.wav | ||
| 277 | - | ||
| 278 | - - uses: actions/upload-artifact@v4 | ||
| 279 | if: matrix.lib_type == 'static' | 203 | if: matrix.lib_type == 'static' |
| 280 | with: | 204 | with: |
| 281 | name: sherpa-onnx-linux-riscv64-static | 205 | name: sherpa-onnx-linux-riscv64-static |
| 282 | path: sherpa-onnx-*linux-riscv64-static.tar.bz2 | 206 | path: sherpa-onnx-*linux-riscv64-static.tar.bz2 |
| 283 | 207 | ||
| 284 | - name: Release pre-compiled binaries and libs for riscv64 linux ${{ matrix.lib_type }} | 208 | - name: Release pre-compiled binaries and libs for riscv64 linux ${{ matrix.lib_type }} |
| 285 | - if: (github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa') && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | 209 | + if: github.repository_owner == 'csukuangfj' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') |
| 210 | + uses: svenstaro/upload-release-action@v2 | ||
| 211 | + with: | ||
| 212 | + file_glob: true | ||
| 213 | + overwrite: true | ||
| 214 | + file: sherpa-onnx-*linux-riscv64*.tar.bz2 | ||
| 215 | + repo_name: k2-fsa/sherpa-onnx | ||
| 216 | + repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | ||
| 217 | + tag: v1.12.11 | ||
| 218 | + | ||
| 219 | + - name: Release pre-compiled binaries and libs for riscv64 linux ${{ matrix.lib_type }} | ||
| 220 | + if: github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') | ||
| 286 | uses: svenstaro/upload-release-action@v2 | 221 | uses: svenstaro/upload-release-action@v2 |
| 287 | with: | 222 | with: |
| 288 | file_glob: true | 223 | file_glob: true |
| 289 | overwrite: true | 224 | overwrite: true |
| 290 | file: sherpa-onnx-*linux-riscv64*.tar.bz2 | 225 | file: sherpa-onnx-*linux-riscv64*.tar.bz2 |
| 226 | + | ||
| 227 | + - name: Test sherpa-onnx | ||
| 228 | + shell: bash | ||
| 229 | + run: | | ||
| 230 | + export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH | ||
| 231 | + export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | ||
| 232 | + export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot | ||
| 233 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/toolchain/sysroot/lib | ||
| 234 | + | ||
| 235 | + ls -lh ./build-riscv64-linux-gnu/bin | ||
| 236 | + | ||
| 237 | + echo "----------sherpa-onnx----------" | ||
| 238 | + qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx --help | ||
| 239 | + readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx | ||
| 240 | + | ||
| 241 | + echo "----------sherpa-onnx-offline----------" | ||
| 242 | + qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline --help | ||
| 243 | + readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline | ||
| 244 | + | ||
| 245 | + echo "----------sherpa-onnx-offline-tts----------" | ||
| 246 | + qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts --help | ||
| 247 | + readelf -d ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts | ||
| 248 | + | ||
| 249 | + - name: Test streaming speech recognition | ||
| 250 | + shell: bash | ||
| 251 | + run: | | ||
| 252 | + export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH | ||
| 253 | + export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | ||
| 254 | + export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot | ||
| 255 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/toolchain/sysroot/lib | ||
| 256 | + | ||
| 257 | + wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2 | ||
| 258 | + tar xvf sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2 | ||
| 259 | + rm sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23.tar.bz2 | ||
| 260 | + | ||
| 261 | + qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx \ | ||
| 262 | + --tokens=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/tokens.txt \ | ||
| 263 | + --encoder=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/encoder-epoch-99-avg-1.onnx \ | ||
| 264 | + --decoder=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/decoder-epoch-99-avg-1.onnx \ | ||
| 265 | + --joiner=./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/joiner-epoch-99-avg-1.onnx \ | ||
| 266 | + ./sherpa-onnx-streaming-zipformer-zh-14M-2023-02-23/test_wavs/0.wav | ||
| 267 | + | ||
| 268 | + - name: Test offline tts | ||
| 269 | + shell: bash | ||
| 270 | + run: | | ||
| 271 | + export PATH=$GITHUB_WORKSPACE/toolchain/bin:$PATH | ||
| 272 | + export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH | ||
| 273 | + export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/sysroot | ||
| 274 | + export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/toolchain/sysroot/lib | ||
| 275 | + | ||
| 276 | + wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-lessac-medium.tar.bz2 | ||
| 277 | + tar xf vits-piper-en_US-lessac-medium.tar.bz2 | ||
| 278 | + rm vits-piper-en_US-lessac-medium.tar.bz2 | ||
| 279 | + | ||
| 280 | + qemu-riscv64 ./build-riscv64-linux-gnu/bin/sherpa-onnx-offline-tts \ | ||
| 281 | + --vits-model=./vits-piper-en_US-lessac-medium/en_US-lessac-medium.onnx \ | ||
| 282 | + --vits-data-dir=./vits-piper-en_US-lessac-medium/espeak-ng-data \ | ||
| 283 | + --vits-tokens=./vits-piper-en_US-lessac-medium/tokens.txt \ | ||
| 284 | + --output-filename=./liliana-piper-en_US-lessac-medium.wav \ | ||
| 285 | + 'liliana, the most beautiful and lovely assistant of our team!' | ||
| 286 | + | ||
| 287 | + - uses: actions/upload-artifact@v4 | ||
| 288 | + if: matrix.lib_type == 'shared' | ||
| 289 | + with: | ||
| 290 | + name: wave | ||
| 291 | + path: ./*.wav |
| @@ -250,7 +250,7 @@ jobs: | @@ -250,7 +250,7 @@ jobs: | ||
| 250 | file: sherpa-onnx-*linux-aarch64*.tar.bz2 | 250 | file: sherpa-onnx-*linux-aarch64*.tar.bz2 |
| 251 | repo_name: k2-fsa/sherpa-onnx | 251 | repo_name: k2-fsa/sherpa-onnx |
| 252 | repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} | 252 | repo_token: ${{ secrets.UPLOAD_GH_SHERPA_ONNX_TOKEN }} |
| 253 | - tag: v1.12.0 | 253 | + tag: v1.12.13 |
| 254 | 254 | ||
| 255 | - name: Test offline Moonshine | 255 | - name: Test offline Moonshine |
| 256 | if: matrix.build_type != 'Debug' | 256 | if: matrix.build_type != 'Debug' |
| @@ -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: |
| @@ -117,6 +108,13 @@ jobs: | @@ -117,6 +108,13 @@ jobs: | ||
| 117 | cd ./java-api-examples | 108 | cd ./java-api-examples |
| 118 | ./run-version-test.sh | 109 | ./run-version-test.sh |
| 119 | 110 | ||
| 111 | + - name: Run java test (Streaming T-one) | ||
| 112 | + shell: bash | ||
| 113 | + run: | | ||
| 114 | + cd ./java-api-examples | ||
| 115 | + ./run-streaming-decode-file-tone-ctc.sh | ||
| 116 | + rm -rf sherpa-onnx-streaming-t-one-* | ||
| 117 | + | ||
| 120 | - name: Run java test (Nemo Canary) | 118 | - name: Run java test (Nemo Canary) |
| 121 | shell: bash | 119 | shell: bash |
| 122 | run: | | 120 | run: | |
| @@ -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: |
| @@ -85,7 +77,7 @@ jobs: | @@ -85,7 +77,7 @@ jobs: | ||
| 85 | - name: Install Python dependencies | 77 | - name: Install Python dependencies |
| 86 | shell: bash | 78 | shell: bash |
| 87 | run: | | 79 | run: | |
| 88 | - python3 -m pip install --upgrade pip numpy pypinyin sentencepiece>=0.1.96 soundfile setuptools wheel | 80 | + python3 -m pip install --upgrade pip numpy pypinyin sentencepiece>=0.1.96 soundfile setuptools wheel librosa |
| 89 | 81 | ||
| 90 | - name: Install sherpa-onnx | 82 | - name: Install sherpa-onnx |
| 91 | shell: bash | 83 | shell: bash |
| @@ -80,7 +80,7 @@ jobs: | @@ -80,7 +80,7 @@ jobs: | ||
| 80 | - name: Install Python dependencies | 80 | - name: Install Python dependencies |
| 81 | shell: bash | 81 | shell: bash |
| 82 | run: | | 82 | run: | |
| 83 | - python3 -m pip install --upgrade pip numpy pypinyin sentencepiece>=0.1.96 soundfile | 83 | + python3 -m pip install --upgrade pip numpy pypinyin sentencepiece>=0.1.96 soundfile librosa |
| 84 | python3 -m pip install wheel twine setuptools | 84 | python3 -m pip install wheel twine setuptools |
| 85 | 85 | ||
| 86 | - uses: afoley587/setup-ffmpeg@main | 86 | - uses: afoley587/setup-ffmpeg@main |
| @@ -157,7 +157,7 @@ jobs: | @@ -157,7 +157,7 @@ jobs: | ||
| 157 | mkdir t | 157 | mkdir t |
| 158 | cd t | 158 | cd t |
| 159 | unzip ../*.whl | 159 | unzip ../*.whl |
| 160 | - readelf -d _sherpa_onnx*.so | 160 | + readelf -d sherpa_onnx/lib/_sherpa_onnx*.so |
| 161 | 161 | ||
| 162 | echo "----" | 162 | echo "----" |
| 163 | 163 | ||
| @@ -170,7 +170,7 @@ jobs: | @@ -170,7 +170,7 @@ jobs: | ||
| 170 | mkdir t | 170 | mkdir t |
| 171 | cd t | 171 | cd t |
| 172 | unzip ../*.whl | 172 | unzip ../*.whl |
| 173 | - readelf -d _sherpa_onnx*.so | 173 | + readelf -d sherpa_onnx/lib/_sherpa_onnx*.so |
| 174 | 174 | ||
| 175 | echo "----" | 175 | echo "----" |
| 176 | 176 |
| @@ -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 | ||
| @@ -48,6 +39,19 @@ jobs: | @@ -48,6 +39,19 @@ jobs: | ||
| 48 | - os: ubuntu-latest | 39 | - os: ubuntu-latest |
| 49 | python-version: "3.13" | 40 | python-version: "3.13" |
| 50 | 41 | ||
| 42 | + - os: ubuntu-24.04-arm | ||
| 43 | + python-version: "3.8" | ||
| 44 | + - os: ubuntu-24.04-arm | ||
| 45 | + python-version: "3.9" | ||
| 46 | + - os: ubuntu-24.04-arm | ||
| 47 | + python-version: "3.10" | ||
| 48 | + - os: ubuntu-24.04-arm | ||
| 49 | + python-version: "3.11" | ||
| 50 | + - os: ubuntu-24.04-arm | ||
| 51 | + python-version: "3.12" | ||
| 52 | + - os: ubuntu-24.04-arm | ||
| 53 | + python-version: "3.13" | ||
| 54 | + | ||
| 51 | - os: macos-13 | 55 | - os: macos-13 |
| 52 | python-version: "3.8" | 56 | python-version: "3.8" |
| 53 | 57 | ||
| @@ -58,8 +62,10 @@ jobs: | @@ -58,8 +62,10 @@ jobs: | ||
| 58 | - os: macos-13 | 62 | - os: macos-13 |
| 59 | python-version: "3.11" | 63 | python-version: "3.11" |
| 60 | 64 | ||
| 61 | - - os: macos-14 | 65 | + - os: macos-latest |
| 62 | python-version: "3.12" | 66 | python-version: "3.12" |
| 67 | + - os: macos-latest | ||
| 68 | + python-version: "3.13" | ||
| 63 | 69 | ||
| 64 | - os: windows-2022 | 70 | - os: windows-2022 |
| 65 | python-version: "3.7" | 71 | python-version: "3.7" |
| @@ -74,6 +80,8 @@ jobs: | @@ -74,6 +80,8 @@ jobs: | ||
| 74 | python-version: "3.11" | 80 | python-version: "3.11" |
| 75 | - os: windows-2022 | 81 | - os: windows-2022 |
| 76 | python-version: "3.12" | 82 | python-version: "3.12" |
| 83 | + - os: windows-latest | ||
| 84 | + python-version: "3.13" | ||
| 77 | 85 | ||
| 78 | steps: | 86 | steps: |
| 79 | - uses: actions/checkout@v4 | 87 | - uses: actions/checkout@v4 |
| @@ -129,6 +137,10 @@ jobs: | @@ -129,6 +137,10 @@ jobs: | ||
| 129 | cd t | 137 | cd t |
| 130 | unzip ../*.whl | 138 | unzip ../*.whl |
| 131 | 139 | ||
| 140 | + ls -lh sherpa_onnx/lib | ||
| 141 | + | ||
| 142 | + file sherpa_onnx/lib/* | ||
| 143 | + | ||
| 132 | - name: Install wheel | 144 | - name: Install wheel |
| 133 | shell: bash | 145 | shell: bash |
| 134 | run: | | 146 | run: | |
| @@ -137,14 +149,5 @@ jobs: | @@ -137,14 +149,5 @@ jobs: | ||
| 137 | - name: Test | 149 | - name: Test |
| 138 | shell: bash | 150 | shell: bash |
| 139 | run: | | 151 | run: | |
| 140 | - # For windows | ||
| 141 | - export PATH=/c/hostedtoolcache/windows/Python/3.7.9/x64/bin:$PATH | ||
| 142 | - export PATH=/c/hostedtoolcache/windows/Python/3.8.10/x64/bin:$PATH | ||
| 143 | - export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH | ||
| 144 | - 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 | ||
| 146 | - 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 | ||
| 148 | - | ||
| 149 | which sherpa-onnx | 152 | which sherpa-onnx |
| 150 | sherpa-onnx --help | 153 | 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 | ||
| @@ -135,7 +127,9 @@ jobs: | @@ -135,7 +127,9 @@ jobs: | ||
| 135 | cp scripts/dart/speaker-id-pubspec.yaml dart-api-examples/speaker-identification/pubspec.yaml | 127 | cp scripts/dart/speaker-id-pubspec.yaml dart-api-examples/speaker-identification/pubspec.yaml |
| 136 | cp scripts/dart/speaker-diarization-pubspec.yaml dart-api-examples/speaker-diarization/pubspec.yaml | 128 | cp scripts/dart/speaker-diarization-pubspec.yaml dart-api-examples/speaker-diarization/pubspec.yaml |
| 137 | cp scripts/dart/speech-enhancement-gtcrn-pubspec.yaml dart-api-examples/speech-enhancement-gtcrn/pubspec.yaml | 129 | cp scripts/dart/speech-enhancement-gtcrn-pubspec.yaml dart-api-examples/speech-enhancement-gtcrn/pubspec.yaml |
| 130 | + cp scripts/dart/slid-pubspec.yaml dart-api-examples/spoken-language-identification/pubspec.yaml | ||
| 138 | 131 | ||
| 139 | cp scripts/dart/sherpa-onnx-pubspec.yaml flutter/sherpa_onnx/pubspec.yaml | 132 | cp scripts/dart/sherpa-onnx-pubspec.yaml flutter/sherpa_onnx/pubspec.yaml |
| 140 | 133 | ||
| 134 | + | ||
| 141 | .github/scripts/test-dart.sh | 135 | .github/scripts/test-dart.sh |
| @@ -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: |
-
请 注册 或 登录 后发表评论