Add WebAssembly for VAD (#1281)
This commit is contained in:
16
.github/workflows/wasm-simd-hf-space-de-tts.yaml
vendored
16
.github/workflows/wasm-simd-hf-space-de-tts.yaml
vendored
@@ -1,9 +1,11 @@
|
||||
name: wasm-simd-hf-space-de-tts
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
branches:
|
||||
- wasm
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -71,6 +73,14 @@ jobs:
|
||||
name: sherpa-onnx-wasm-simd-de-tts
|
||||
path: ./sherpa-onnx-wasm-simd-*.tar.bz2
|
||||
|
||||
- name: 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
|
||||
overwrite: true
|
||||
file: ./*.tar.bz2
|
||||
|
||||
- name: Publish to ModelScope
|
||||
# if: false
|
||||
env:
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
name: wasm-simd-hf-space-en-asr-zipformer
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
branches:
|
||||
- wasm
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -73,6 +75,14 @@ jobs:
|
||||
name: sherpa-onnx-wasm-simd-en-asr-zipformer
|
||||
path: ./sherpa-onnx-wasm-simd-*.tar.bz2
|
||||
|
||||
- name: 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
|
||||
overwrite: true
|
||||
file: ./*.tar.bz2
|
||||
|
||||
- name: Publish to ModelScope
|
||||
# if: false
|
||||
env:
|
||||
|
||||
16
.github/workflows/wasm-simd-hf-space-en-tts.yaml
vendored
16
.github/workflows/wasm-simd-hf-space-en-tts.yaml
vendored
@@ -1,9 +1,11 @@
|
||||
name: wasm-simd-hf-space-en-tts
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
branches:
|
||||
- wasm
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -69,6 +71,14 @@ jobs:
|
||||
name: sherpa-onnx-wasm-simd-en-tts
|
||||
path: ./sherpa-onnx-wasm-simd-*.tar.bz2
|
||||
|
||||
- name: 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
|
||||
overwrite: true
|
||||
file: ./*.tar.bz2
|
||||
|
||||
- name: Publish to ModelScope
|
||||
# if: false
|
||||
env:
|
||||
|
||||
152
.github/workflows/wasm-simd-hf-space-silero-vad.yaml
vendored
Normal file
152
.github/workflows/wasm-simd-hf-space-silero-vad.yaml
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
name: wasm-simd-hf-space-silero-vad
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- wasm
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: wasm-simd-hf-space-silero-vad-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
wasm-simd-hf-space-silero-vad:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: 3.1.51
|
||||
actions-cache-folder: 'emsdk-cache'
|
||||
|
||||
- name: View emsdk version
|
||||
shell: bash
|
||||
run: |
|
||||
emcc -v
|
||||
echo "--------------------"
|
||||
emcc --check
|
||||
|
||||
- name: Download model files
|
||||
shell: bash
|
||||
run: |
|
||||
cd wasm/vad/assets
|
||||
ls -lh
|
||||
echo "----------"
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/silero_vad.onnx
|
||||
ls -lh
|
||||
|
||||
- name: Build sherpa-onnx for WebAssembly
|
||||
shell: bash
|
||||
run: |
|
||||
./build-wasm-simd-vad.sh
|
||||
|
||||
- name: collect files
|
||||
shell: bash
|
||||
run: |
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
|
||||
dst=sherpa-onnx-wasm-simd-${SHERPA_ONNX_VERSION}-vad
|
||||
mv build-wasm-simd-vad/install/bin/wasm/vad $dst
|
||||
ls -lh $dst
|
||||
tar cjfv $dst.tar.bz2 ./$dst
|
||||
|
||||
- name: Upload wasm files
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: sherpa-onnx-wasm-simd-vad
|
||||
path: ./sherpa-onnx-wasm-simd-*.tar.bz2
|
||||
|
||||
- name: 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
|
||||
overwrite: true
|
||||
file: ./*.tar.bz2
|
||||
|
||||
- name: Publish to ModelScope
|
||||
# if: false
|
||||
env:
|
||||
MS_TOKEN: ${{ secrets.MODEL_SCOPE_GIT_TOKEN }}
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf ms
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
git clone https://www.modelscope.cn/studios/csukuangfj/web-assembly-vad-sherpa-onnx.git ms
|
||||
cd ms
|
||||
rm -fv *.js
|
||||
rm -fv *.data
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
cp -v ../sherpa-onnx-wasm-simd-${SHERPA_ONNX_VERSION}-vad/* .
|
||||
|
||||
git status
|
||||
git lfs track "*.data"
|
||||
git lfs track "*.wasm"
|
||||
ls -lh
|
||||
|
||||
git add .
|
||||
git commit -m "update model"
|
||||
git push https://oauth2:${MS_TOKEN}@www.modelscope.cn/studios/csukuangfj/web-assembly-vad-sherpa-onnx.git
|
||||
|
||||
- name: Publish to huggingface
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
uses: nick-fields/retry@v2
|
||||
with:
|
||||
max_attempts: 20
|
||||
timeout_seconds: 200
|
||||
shell: bash
|
||||
command: |
|
||||
SHERPA_ONNX_VERSION=v$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2)
|
||||
|
||||
git config --global user.email "csukuangfj@gmail.com"
|
||||
git config --global user.name "Fangjun Kuang"
|
||||
|
||||
rm -rf huggingface
|
||||
export GIT_LFS_SKIP_SMUDGE=1
|
||||
export GIT_CLONE_PROTECTION_ACTIVE=false
|
||||
|
||||
git clone https://huggingface.co/spaces/k2-fsa/web-assembly-vad-sherpa-onnx huggingface
|
||||
cd huggingface
|
||||
rm -fv *.js
|
||||
rm -fv *.data
|
||||
git fetch
|
||||
git pull
|
||||
git merge -m "merge remote" --ff origin main
|
||||
|
||||
cp -v ../sherpa-onnx-wasm-simd-${SHERPA_ONNX_VERSION}-vad/* .
|
||||
|
||||
git status
|
||||
git lfs track "*.data"
|
||||
git lfs track "*.wasm"
|
||||
ls -lh
|
||||
|
||||
git add .
|
||||
git commit -m "update model"
|
||||
git push https://csukuangfj:$HF_TOKEN@huggingface.co/spaces/k2-fsa/web-assembly-vad-sherpa-onnx main
|
||||
@@ -1,9 +1,11 @@
|
||||
name: wasm-simd-hf-space-zh-cantonese-en-asr-paraformer
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
branches:
|
||||
- wasm
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -80,6 +82,14 @@ jobs:
|
||||
name: sherpa-onnx-wasm-simd-zh-cantonese-en-asr-paraformer
|
||||
path: ./sherpa-onnx-wasm-simd-*.tar.bz2
|
||||
|
||||
- name: 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
|
||||
overwrite: true
|
||||
file: ./*.tar.bz2
|
||||
|
||||
- name: Publish to huggingface
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
name: wasm-simd-hf-space-zh-en-asr-paraformer
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
branches:
|
||||
- wasm
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -80,6 +82,14 @@ jobs:
|
||||
name: sherpa-onnx-wasm-simd-zh-en-asr-paraformer
|
||||
path: ./sherpa-onnx-wasm-simd-*.tar.bz2
|
||||
|
||||
- name: 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
|
||||
overwrite: true
|
||||
file: ./*.tar.bz2
|
||||
|
||||
- name: Publish to ModelScope
|
||||
# if: false
|
||||
env:
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
name: wasm-simd-hf-space-zh-en-asr-zipformer
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
push:
|
||||
branches:
|
||||
- wasm
|
||||
tags:
|
||||
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -71,6 +73,14 @@ jobs:
|
||||
name: sherpa-onnx-wasm-simd-zh-en-asr-zipformer
|
||||
path: ./sherpa-onnx-wasm-simd-*.tar.bz2
|
||||
|
||||
- name: 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
|
||||
overwrite: true
|
||||
file: ./*.tar.bz2
|
||||
|
||||
- name: Publish to ModelScope
|
||||
# if: false
|
||||
env:
|
||||
|
||||
Reference in New Issue
Block a user