Add JavaScript API (WASM) for homophone replacer (#2157)

This commit is contained in:
Fangjun Kuang
2025-04-28 20:47:49 +08:00
committed by GitHub
parent e51c37eb2f
commit a0aef1f6cd
13 changed files with 165 additions and 24 deletions

View File

@@ -144,7 +144,18 @@ tar xvf sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
rm sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
node ./test-offline-sense-voice.js
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/hr-files/dict.tar.bz2
tar xf dict.tar.bz2
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/hr-files/replace.fst
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/hr-files/test-hr.wav
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/hr-files/lexicon.txt
node ./test-offline-sense-voice-with-hr.js
rm -rf sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17
rm -rf dict replace.fst test-hr.wav lexicon.txt
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
ls -lh

View File

@@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-22.04]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:

View File

@@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
os: [ubuntu-22.04]
python-version: ["cp37", "cp38", "cp39", "cp310", "cp311", "cp312", "cp313"]
manylinux: [manylinux2014] #, manylinux_2_28]

View File

@@ -35,11 +35,11 @@ jobs:
matrix:
# See https://github.com/actions/runner-images
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
python-version: "3.7"
- os: ubuntu-20.04
- os: ubuntu-22.04
python-version: "3.8"
- os: ubuntu-20.04
- os: ubuntu-22.04
python-version: "3.9"
- os: ubuntu-22.04
python-version: "3.10"
@@ -48,7 +48,7 @@ jobs:
- os: ubuntu-22.04
python-version: "3.12"
- os: macos-12
- os: macos-13
python-version: "3.8"
- os: macos-13
@@ -137,8 +137,8 @@ jobs:
export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.11.9/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.12.9/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.13.2/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.12.10/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.13.3/x64/bin:$PATH
which sherpa-onnx
sherpa-onnx --help

View File

@@ -40,7 +40,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-14, ubuntu-20.04, ubuntu-22.04, windows-latest]
os: [macos-latest, macos-14, ubuntu-latest, ubuntu-22.04, windows-latest]
node-version: ["16", "17", "18", "19", "21", "22"]
steps:

View File

@@ -30,11 +30,11 @@ jobs:
matrix:
# See https://github.com/actions/runner-images
include:
- os: ubuntu-20.04
- os: ubuntu-22.04
python-version: "3.7"
- os: ubuntu-20.04
- os: ubuntu-22.04
python-version: "3.8"
- os: ubuntu-20.04
- os: ubuntu-22.04
python-version: "3.9"
- os: ubuntu-22.04
python-version: "3.10"
@@ -45,7 +45,7 @@ jobs:
- os: ubuntu-22.04
python-version: "3.13"
- os: macos-12
- os: macos-13
python-version: "3.8"
- os: macos-13
@@ -110,8 +110,8 @@ jobs:
export PATH=/c/hostedtoolcache/windows/Python/3.9.13/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.10.11/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.11.9/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.12.9/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.13.2/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.12.10/x64/bin:$PATH
export PATH=/c/hostedtoolcache/windows/Python/3.13.3/x64/bin:$PATH
sherpa-onnx --help
sherpa-onnx-keyword-spotter --help

View File

@@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, windows-latest, macos-latest, macos-14]
os: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-14]
python-version: ["3.10"]
model_type: ["transducer", "paraformer", "nemo_ctc", "whisper", "tdnn"]

View File

@@ -33,7 +33,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, windows-latest, macos-latest, macos-14]
os: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-14]
python-version: ["3.10"]
model_type: ["transducer", "paraformer", "zipformer2-ctc"]