-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38ad05b
commit fe977b8
Showing
34 changed files
with
2,704 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
echo "dir: $d" | ||
cd $d | ||
npm install | ||
git status | ||
ls -lh | ||
ls -lh node_modules | ||
|
||
# offline asr | ||
|
||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-ctc-en-conformer-small.tar.bz2 | ||
tar xvf sherpa-onnx-nemo-ctc-en-conformer-small.tar.bz2 | ||
rm sherpa-onnx-nemo-ctc-en-conformer-small.tar.bz2 | ||
node ./test-offline-nemo-ctc.js | ||
rm -rf sherpa-onnx-nemo-ctc-en-conformer-small | ||
|
||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2 | ||
tar xvf sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2 | ||
rm sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2 | ||
node ./test-offline-paraformer.js | ||
rm -rf sherpa-onnx-paraformer-zh-2023-03-28 | ||
|
||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-en-2023-06-26.tar.bz2 | ||
tar xvf sherpa-onnx-zipformer-en-2023-06-26.tar.bz2 | ||
rm sherpa-onnx-zipformer-en-2023-06-26.tar.bz2 | ||
node ./test-offline-transducer.js | ||
rm -rf sherpa-onnx-zipformer-en-2023-06-26 | ||
|
||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-tiny.en.tar.bz2 | ||
tar xvf sherpa-onnx-whisper-tiny.en.tar.bz2 | ||
rm sherpa-onnx-whisper-tiny.en.tar.bz2 | ||
node ./test-offline-whisper.js | ||
rm -rf sherpa-onnx-whisper-tiny.en | ||
|
||
# online asr | ||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-paraformer-bilingual-zh-en.tar.bz2 | ||
tar xvf sherpa-onnx-streaming-paraformer-bilingual-zh-en.tar.bz2 | ||
rm sherpa-onnx-streaming-paraformer-bilingual-zh-en.tar.bz2 | ||
node ./test-online-paraformer.js | ||
rm -rf sherpa-onnx-streaming-paraformer-bilingual-zh-en | ||
|
||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | ||
tar xvf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | ||
rm sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | ||
node ./test-online-transducer.js | ||
rm -rf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 | ||
|
||
# offline tts | ||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-vctk.tar.bz2 | ||
tar xvf vits-vctk.tar.bz2 | ||
rm vits-vctk.tar.bz2 | ||
node ./test-offline-tts-en.js | ||
rm -rf vits-vctk | ||
|
||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-zh-aishell3.tar.bz2 | ||
tar xvf vits-zh-aishell3.tar.bz2 | ||
rm vits-zh-aishell3.tar.bz2 | ||
node ./test-offline-tts-zh.js | ||
rm -rf vits-zh-aishell3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches: | ||
- dot-net | ||
- fix-dot-net | ||
tags: | ||
- '*' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: npm | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: npm-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
nodejs: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.8"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 13 | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Display node version | ||
shell: bash | ||
run: | | ||
node --version | ||
npm --version | ||
cd nodejs-examples | ||
npm install [email protected] -g | ||
npm install [email protected] | ||
npm --version | ||
- name: Build nodejs package | ||
shell: bash | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
cd scripts/nodejs | ||
./run.sh | ||
npm install | ||
rm run.sh | ||
npm ci | ||
npm publish --provenance --access public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: test-nodejs-npm | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
schedule: | ||
# minute (0-59) | ||
# hour (0-23) | ||
# day of the month (1-31) | ||
# month (1-12) | ||
# day of the week (0-6) | ||
# nightly build at 23:50 UTC time every day | ||
- cron: "50 23 * * *" | ||
|
||
concurrency: | ||
group: test-nodejs-npm-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test-nodejs-npm: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] #, windows-latest] | ||
python-version: ["3.8"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 13 | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Display node version | ||
shell: bash | ||
run: | | ||
node --version | ||
npm --version | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
node --version | ||
npm --version | ||
export d=nodejs-examples | ||
./.github/scripts/test-nodejs-npm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
name: test-nodejs | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
branches: | ||
- master | ||
|
||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: test-nodejs-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test-nodejs: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] #, windows-latest] | ||
python-version: ["3.8"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ${{ matrix.os }}-Release-ON | ||
|
||
- name: Configure CMake | ||
shell: bash | ||
run: | | ||
export CMAKE_CXX_COMPILER_LAUNCHER=ccache | ||
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | ||
cmake --version | ||
mkdir build | ||
cd build | ||
cmake -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=./install .. | ||
make -j2 | ||
make install | ||
ls -lh install/lib | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Copy files | ||
shell: bash | ||
run: | | ||
os=${{ matrix.os }} | ||
if [[ $os == 'ubuntu-latest' ]]; then | ||
mkdir -p scripts/nodejs/lib/linux-x64 | ||
dst=scripts/nodejs/lib/linux-x64 | ||
elif [[ $os == 'macos-latest' ]]; then | ||
mkdir -p scripts/nodejs/lib/osx-x64 | ||
dst=scripts/nodejs/lib/osx-x64 | ||
fi | ||
cp -v build/install/lib/* $dst/ | ||
- name: replace files | ||
shell: bash | ||
run: | | ||
cd nodejs-examples | ||
files=$(ls -1 *.js) | ||
for f in ${files[@]}; do | ||
echo $f | ||
sed -i.bak s%\'sherpa-onnx\'%\'./index.js\'% $f | ||
git status | ||
done | ||
git diff | ||
cp *.js ../scripts/nodejs | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 13 | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Display node version | ||
shell: bash | ||
run: | | ||
node --version | ||
npm --version | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
node --version | ||
npm --version | ||
export d=scripts/nodejs | ||
pushd $d | ||
npm install | ||
npm install wav | ||
popd | ||
./.github/scripts/test-nodejs-npm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,3 +67,6 @@ swift-api-examples/k2fsa-* | |
run-*.sh | ||
two-pass-*.sh | ||
build-* | ||
vits-vctk | ||
vits-zh-aishell3 | ||
jslint.mjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
package-lock.json |
Oops, something went wrong.