diff --git a/.github/workflows/android.yaml b/.github/workflows/android.yaml index 3f9f63b08..c7995ff4a 100644 --- a/.github/workflows/android.yaml +++ b/.github/workflows/android.yaml @@ -11,6 +11,8 @@ on: - 'sherpa-onnx/csrc/*' - 'sherpa-onnx/jni/*' - 'build-android*.sh' + tags: + - '*' pull_request: branches: - master @@ -22,10 +24,6 @@ on: - 'sherpa-onnx/jni/*' - 'build-android*.sh' - release: - types: - - published - workflow_dispatch: inputs: release: @@ -112,7 +110,7 @@ jobs: # https://huggingface.co/docs/hub/spaces-github-actions - name: Publish to huggingface - if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | @@ -136,7 +134,7 @@ jobs: git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main - name: Release android libs - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/arm-linux-gnueabihf.yaml b/.github/workflows/arm-linux-gnueabihf.yaml index 0c1efde92..6d6834c25 100644 --- a/.github/workflows/arm-linux-gnueabihf.yaml +++ b/.github/workflows/arm-linux-gnueabihf.yaml @@ -11,6 +11,8 @@ on: - 'cmake/**' - 'sherpa-onnx/csrc/*' - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' + tags: + - '*' pull_request: branches: - master @@ -20,20 +22,8 @@ on: - 'cmake/**' - 'sherpa-onnx/csrc/*' - 'toolchains/arm-linux-gnueabihf.toolchain.cmake' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: arm-linux-gnueabihf-${{ github.ref }} @@ -131,7 +121,6 @@ jobs: export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH export QEMU_LD_PREFIX=$GITHUB_WORKSPACE/toolchain/arm-linux-gnueabihf/libc - ls -lh ./build-arm-linux-gnueabihf/bin qemu-arm ./build-arm-linux-gnueabihf/bin/sherpa-onnx --help @@ -156,7 +145,7 @@ jobs: path: sherpa-onnx-*linux-arm-gnueabihf.tar.bz2 - name: Release pre-compiled binaries and libs for arm linux gnueabihf - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/build-xcframework.yaml b/.github/workflows/build-xcframework.yaml index 576b2d083..8c2ffaa09 100644 --- a/.github/workflows/build-xcframework.yaml +++ b/.github/workflows/build-xcframework.yaml @@ -14,15 +14,6 @@ on: - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: build-xcframework-${{ github.ref }} @@ -76,7 +67,7 @@ jobs: # https://huggingface.co/docs/hub/spaces-github-actions - name: Publish to huggingface - if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | @@ -100,7 +91,7 @@ jobs: git push https://csukuangfj:$HF_TOKEN@huggingface.co/csukuangfj/sherpa-onnx-libs main - name: Release xcframework - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/dot-net.yaml b/.github/workflows/dot-net.yaml index bcff2f312..7c33c9090 100644 --- a/.github/workflows/dot-net.yaml +++ b/.github/workflows/dot-net.yaml @@ -6,20 +6,8 @@ on: - dot-net tags: - '*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: dot-net-${{ github.ref }} @@ -138,7 +126,7 @@ jobs: path: scripts/dotnet/packages/*.nupkg - name: publish .Net packages to nuget.org - if: github.repository == 'csukuangfj/sherpa-onnx' || github.repository == 'k2-fsa/sherpa-onnx' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') shell: bash env: API_KEY: ${{ secrets.NUGET_API_KEY }} @@ -148,7 +136,7 @@ jobs: dotnet nuget push ./org.k2fsa.sherpa.onnx.*.nupkg --skip-duplicate --api-key $API_KEY --source https://api.nuget.org/v3/index.json - name: Release nuget packages - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/jni.yaml b/.github/workflows/jni.yaml index 1dbccb4f0..853d2dcb9 100644 --- a/.github/workflows/jni.yaml +++ b/.github/workflows/jni.yaml @@ -22,6 +22,8 @@ on: - 'sherpa-onnx/csrc/*' - 'sherpa-onnx/jni/*' + workflow_dispatch: + concurrency: group: jni-${{ github.ref }} cancel-in-progress: true diff --git a/.github/workflows/linux-gpu.yaml b/.github/workflows/linux-gpu.yaml index 25350a319..de4e3e5af 100644 --- a/.github/workflows/linux-gpu.yaml +++ b/.github/workflows/linux-gpu.yaml @@ -30,20 +30,8 @@ on: - 'cmake/**' - 'sherpa-onnx/csrc/*' - 'sherpa-onnx/c-api/*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: linux-gpu-${{ github.ref }} @@ -136,7 +124,7 @@ jobs: .github/scripts/test-online-transducer.sh - name: Copy files - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') shell: bash run: | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) @@ -153,7 +141,7 @@ jobs: tar cjvf ${dst}.tar.bz2 $dst - name: Release pre-compiled binaries and libs for linux x64 - if: env.RELEASE == 'true' && matrix.build_type == 'Release' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 2c026fc0e..bbb2c775b 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -30,20 +30,8 @@ on: - 'cmake/**' - 'sherpa-onnx/csrc/*' - 'sherpa-onnx/c-api/*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: linux-${{ github.ref }} @@ -135,7 +123,7 @@ jobs: .github/scripts/test-online-transducer.sh - name: Copy files - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') shell: bash run: | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) @@ -152,7 +140,7 @@ jobs: tar cjvf ${dst}.tar.bz2 $dst - name: Release pre-compiled binaries and libs for linux x64 - if: env.RELEASE == 'true' && matrix.build_type == 'Release' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index f103061f7..5cc6e83e2 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -4,6 +4,8 @@ on: push: branches: - master + tags: + - '*' paths: - '.github/workflows/macos.yaml' - '.github/scripts/test-online-transducer.sh' @@ -25,20 +27,8 @@ on: - 'CMakeLists.txt' - 'cmake/**' - 'sherpa-onnx/csrc/*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: macos-${{ github.ref }} @@ -133,7 +123,7 @@ jobs: .github/scripts/test-online-transducer.sh - name: Copy files - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') shell: bash run: | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) @@ -151,7 +141,7 @@ jobs: tar cjvf ${dst}.tar.bz2 $dst - name: Release pre-compiled binaries and libs for macOS - if: env.RELEASE == 'true' && matrix.build_type == 'Release' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/mfc.yaml b/.github/workflows/mfc.yaml index cdf5f9c15..7d0061c62 100644 --- a/.github/workflows/mfc.yaml +++ b/.github/workflows/mfc.yaml @@ -21,20 +21,8 @@ on: - 'cmake/**' - 'mfc-examples/**' - 'sherpa-onnx/csrc/*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: mfc-${{ github.ref }} @@ -114,7 +102,7 @@ jobs: path: ./mfc-examples/${{ matrix.arch }}/Release/NonStreamingSpeechRecognition.exe - name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }} - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true @@ -122,7 +110,7 @@ jobs: file: ./mfc-examples/${{ matrix.arch }}/Release/sherpa-onnx-streaming-*.exe - name: Release pre-compiled binaries and libs for Windows ${{ matrix.arch }} - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/windows-x64-cuda.yaml b/.github/workflows/windows-x64-cuda.yaml index 17e53d8b1..afbb501c4 100644 --- a/.github/workflows/windows-x64-cuda.yaml +++ b/.github/workflows/windows-x64-cuda.yaml @@ -27,20 +27,8 @@ on: - 'CMakeLists.txt' - 'cmake/**' - 'sherpa-onnx/csrc/*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: windows-x64-cuda-${{ github.ref }} @@ -125,7 +113,7 @@ jobs: .github/scripts/test-online-transducer.sh - name: Copy files - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') shell: bash run: | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) @@ -140,7 +128,7 @@ jobs: tar cjvf ${dst}.tar.bz2 $dst - name: Release pre-compiled binaries and libs for Windows x64 CUDA - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/windows-x64.yaml b/.github/workflows/windows-x64.yaml index c63dbae30..c491b37d6 100644 --- a/.github/workflows/windows-x64.yaml +++ b/.github/workflows/windows-x64.yaml @@ -27,20 +27,8 @@ on: - 'CMakeLists.txt' - 'cmake/**' - 'sherpa-onnx/csrc/*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: windows-x64-${{ github.ref }} @@ -126,7 +114,7 @@ jobs: .github/scripts/test-online-transducer.sh - name: Copy files - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') shell: bash run: | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) @@ -141,7 +129,7 @@ jobs: tar cjvf ${dst}.tar.bz2 $dst - name: Release pre-compiled binaries and libs for Windows x64 - if: env.RELEASE == 'true' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/.github/workflows/windows-x86.yaml b/.github/workflows/windows-x86.yaml index b39a1ddcf..e74aa54b2 100644 --- a/.github/workflows/windows-x86.yaml +++ b/.github/workflows/windows-x86.yaml @@ -4,6 +4,8 @@ on: push: branches: - master + tags: + - '*' paths: - '.github/workflows/windows-x86.yaml' - '.github/scripts/test-online-transducer.sh' @@ -25,20 +27,8 @@ on: - 'CMakeLists.txt' - 'cmake/**' - 'sherpa-onnx/csrc/*' - release: - types: - - published workflow_dispatch: - inputs: - release: - description: "Whether to release" - type: boolean - -env: - RELEASE: - |- # Release if there is a release tag name or a release flag in workflow_dispatch - ${{ github.event.release.tag_name != '' || github.event.inputs.release == 'true' }} concurrency: group: windows-x86-${{ github.ref }} @@ -124,7 +114,7 @@ jobs: .github/scripts/test-online-transducer.sh - name: Copy files - if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') shell: bash run: | SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) @@ -139,7 +129,7 @@ jobs: tar cjvf ${dst}.tar.bz2 $dst - name: Release pre-compiled binaries and libs for Windows x86 - if: env.RELEASE == 'true' && matrix.vs-version == 'vs2015' + if: github.repository_owner == 'csukuangfj' || github.repository_owner == 'k2-fsa' && github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 with: file_glob: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 70046c0d2..bf877a53b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.13 FATAL_ERROR) project(sherpa-onnx) -set(SHERPA_ONNX_VERSION "1.7.11") +set(SHERPA_ONNX_VERSION "1.7.12") # Disable warning about # diff --git a/scripts/go/sherpa_onnx.go b/scripts/go/sherpa_onnx.go index f4fe6998d..96e0db7e8 100644 --- a/scripts/go/sherpa_onnx.go +++ b/scripts/go/sherpa_onnx.go @@ -407,7 +407,7 @@ func NewOfflineRecognizer(config *OfflineRecognizerConfig) *OfflineRecognizer { c.model_config.whisper.decoder = C.CString(config.ModelConfig.Whisper.Decoder) defer C.free(unsafe.Pointer(c.model_config.whisper.decoder)) - c.model_config.tdnn.decoder = C.CString(config.ModelConfig.Tdnn.Model) + c.model_config.tdnn.model = C.CString(config.ModelConfig.Tdnn.Model) defer C.free(unsafe.Pointer(c.model_config.tdnn.model)) c.model_config.tokens = C.CString(config.ModelConfig.Tokens)