Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2024-03-01 15:20:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-03-01 15:20:56 +0800
Commit
f9db33c9268b20e7bc50c24637fb04bf3fa83e65
f9db33c9
1 parent
c093880d
Add WebAssembly demo for streaming trilingual Paraformer (Chinese+Cantonese+English) (#618)
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
157 行增加
和
0 行删除
.github/workflows/wasm-simd-hf-space-de-tts.yaml
.github/workflows/wasm-simd-hf-space-en-asr-zipformer.yaml
.github/workflows/wasm-simd-hf-space-en-tts.yaml
.github/workflows/wasm-simd-hf-space-zh-cantonese-en-asr-paraformer.yaml
.github/workflows/wasm-simd-hf-space-zh-en-asr-paraformer.yaml
.github/workflows/wasm-simd-hf-space-zh-en-asr-zipformer.yaml
.github/workflows/wasm-simd-hf-space-de-tts.yaml
查看文件 @
f9db33c
...
...
@@ -72,6 +72,7 @@ jobs:
path
:
./sherpa-onnx-wasm-simd-*.tar.bz2
-
name
:
Publish to ModelScope
if
:
false
env
:
MS_TOKEN
:
${{ secrets.MODEL_SCOPE_GIT_TOKEN }}
uses
:
nick-fields/retry@v2
...
...
.github/workflows/wasm-simd-hf-space-en-asr-zipformer.yaml
查看文件 @
f9db33c
...
...
@@ -74,6 +74,7 @@ jobs:
path
:
./sherpa-onnx-wasm-simd-*.tar.bz2
-
name
:
Publish to ModelScope
if
:
false
env
:
MS_TOKEN
:
${{ secrets.MODEL_SCOPE_GIT_TOKEN }}
uses
:
nick-fields/retry@v2
...
...
.github/workflows/wasm-simd-hf-space-en-tts.yaml
查看文件 @
f9db33c
...
...
@@ -70,6 +70,7 @@ jobs:
path
:
./sherpa-onnx-wasm-simd-*.tar.bz2
-
name
:
Publish to ModelScope
if
:
false
env
:
MS_TOKEN
:
${{ secrets.MODEL_SCOPE_GIT_TOKEN }}
uses
:
nick-fields/retry@v2
...
...
.github/workflows/wasm-simd-hf-space-zh-cantonese-en-asr-paraformer.yaml
0 → 100644
查看文件 @
f9db33c
name
:
wasm-simd-hf-space-zh-cantonese-en-asr-paraformer
on
:
release
:
types
:
-
published
workflow_dispatch
:
concurrency
:
group
:
wasm-simd-hf-space-zh-cantonese-en-asr-paraformer-${{ github.ref }}
cancel-in-progress
:
true
jobs
:
wasm-simd-hf-space-zh-cantonese-en-asr-paraformer
:
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
-
name
:
View emsdk version
shell
:
bash
run
:
|
emcc -v
echo "--------------------"
emcc --check
-
name
:
Download model files
shell
:
bash
run
:
|
cd wasm/asr/assets
ls -lh
echo "----------"
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en.tar.bz2
tar xvf sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en.tar.bz2
rm sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en.tar.bz2
mv sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en/encoder.int8.onnx encoder.onnx
mv sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en/decoder.int8.onnx decoder.onnx
mv sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en/tokens.txt ./
rm -rf sherpa-onnx-streaming-paraformer-trilingual-zh-cantonese-en
ls -lh
cd ../
sed -i.bak s/"type = 0"/"type = 1"/g ./sherpa-onnx.js
sed -i.bak s/Zipformer/Paraformer/g ./index.html
git diff
-
name
:
Build sherpa-onnx for WebAssembly (ASR)
shell
:
bash
run
:
|
./build-wasm-simd-asr.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}-zh-cantonese-en-asr-paraformer
mv build-wasm-simd-asr/install/bin/wasm/asr $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-zh-cantonese-en-asr-paraformer
path
:
./sherpa-onnx-wasm-simd-*.tar.bz2
-
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
git clone https://huggingface.co/spaces/k2-fsa/web-assembly-asr-sherpa-onnx-zh-cantonese-en-paraformer huggingface
cd huggingface
git fetch
git pull
git merge -m "merge remote" --ff origin main
cp -v ../sherpa-onnx-wasm-simd-${SHERPA_ONNX_VERSION}-*/* .
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-asr-sherpa-onnx-zh-cantonese-en-paraformer main
-
name
:
Publish to ModelScope
if
:
false
env
:
MS_TOKEN
:
${{ secrets.MODEL_SCOPE_GIT_TOKEN }}
uses
:
nick-fields/retry@v2
with
:
max_attempts
:
10
timeout_seconds
:
600
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
git clone https://www.modelscope.cn/studios/k2-fsa/web-assembly-asr-sherpa-onnx-zh-cantonese-en-paraformer.git ms
cd ms
git config lfs.locksverify true
git fetch
git pull
git merge -m "merge remote" --ff origin main
cp -v ../sherpa-onnx-wasm-simd-${SHERPA_ONNX_VERSION}-*/* .
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/k2-fsa/web-assembly-asr-sherpa-onnx-zh-cantonese-en-paraformer.git
...
...
.github/workflows/wasm-simd-hf-space-zh-en-asr-paraformer.yaml
查看文件 @
f9db33c
...
...
@@ -81,6 +81,7 @@ jobs:
path
:
./sherpa-onnx-wasm-simd-*.tar.bz2
-
name
:
Publish to ModelScope
if
:
false
env
:
MS_TOKEN
:
${{ secrets.MODEL_SCOPE_GIT_TOKEN }}
uses
:
nick-fields/retry@v2
...
...
.github/workflows/wasm-simd-hf-space-zh-en-asr-zipformer.yaml
查看文件 @
f9db33c
...
...
@@ -72,6 +72,7 @@ jobs:
path
:
./sherpa-onnx-wasm-simd-*.tar.bz2
-
name
:
Publish to ModelScope
if
:
false
env
:
MS_TOKEN
:
${{ secrets.MODEL_SCOPE_GIT_TOKEN }}
uses
:
nick-fields/retry@v2
...
...
请
注册
或
登录
后发表评论