-
Notifications
You must be signed in to change notification settings - Fork 414
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
Showing
194 changed files
with
8,727 additions
and
808 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,3 @@ | ||
# Introduction | ||
|
||
Please see [sherpa-onnx-node](https://www.npmjs.com/package/sherpa-onnx-node) |
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,11 @@ | ||
# Introduction | ||
|
||
Please see | ||
https://github.com/k2-fsa/sherpa-onnx/blob/master/nodejs-addon-examples/README.md | ||
for usages. | ||
|
||
|
||
||Method|Support multiple threads|Minimum required node version| | ||
|---|---|---|---| | ||
|this package| https://github.com/nodejs/node-addon-api | Yes | v10| | ||
|https://www.npmjs.com/package/sherpa-onnx| WebAssembly | No | v18| |
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 @@ | ||
module.exports = require('./sherpa-onnx.node'); |
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,9 @@ | ||
# Introduction | ||
|
||
See also | ||
|
||
- https://github.com/WonderInventions/node-webrtc/blob/develop/package.json | ||
- https://stackoverflow.com/questions/15176082/npm-package-json-os-specific-dependency | ||
- https://github.com/WonderInventions/node-webrtc/blob/develop/lib/binding.js | ||
- cross-compiling https://github.com/nodejs/node-gyp/issues/829#issuecomment-665527032 | ||
- https://nodejs.github.io/node-addon-examples/build-tools/cmake-js |
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,53 @@ | ||
{ | ||
"name": "sherpa-onnx-PLATFORM2-ARCH", | ||
"version": "SHERPA_ONNX_VERSION", | ||
"description": "Speech-to-text and text-to-speech using Next-gen Kaldi without internet connection", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/k2-fsa/sherpa-onnx.git" | ||
}, | ||
"keywords": [ | ||
"speech to text", | ||
"text to speech", | ||
"transcription", | ||
"real-time speech recognition", | ||
"without internet connection", | ||
"embedded systems", | ||
"open source", | ||
"zipformer", | ||
"asr", | ||
"tts", | ||
"stt", | ||
"c++", | ||
"onnxruntime", | ||
"onnx", | ||
"ai", | ||
"next-gen kaldi", | ||
"offline", | ||
"privacy", | ||
"open source", | ||
"vad", | ||
"speaker id", | ||
"language id", | ||
"node-addon-api", | ||
"streaming speech recognition", | ||
"speech", | ||
"recognition" | ||
], | ||
"author": "The next-gen Kaldi team", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/k2-fsa/sherpa-onnx/issues" | ||
}, | ||
"homepage": "https://github.com/k2-fsa/sherpa-onnx#readme", | ||
"os": [ | ||
"PLATFORM" | ||
], | ||
"cpu": [ | ||
"ARCH" | ||
] | ||
} |
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,54 @@ | ||
{ | ||
"name": "sherpa-onnx-node", | ||
"version": "SHERPA_ONNX_VERSION", | ||
"description": "Speech-to-text and text-to-speech using Next-gen Kaldi without internet connection", | ||
"main": "sherpa-onnx.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/k2-fsa/sherpa-onnx.git" | ||
}, | ||
"keywords": [ | ||
"speech to text", | ||
"text to speech", | ||
"transcription", | ||
"real-time speech recognition", | ||
"without internet connection", | ||
"embedded systems", | ||
"open source", | ||
"zipformer", | ||
"asr", | ||
"tts", | ||
"stt", | ||
"c++", | ||
"onnxruntime", | ||
"onnx", | ||
"ai", | ||
"next-gen kaldi", | ||
"offline", | ||
"privacy", | ||
"open source", | ||
"vad", | ||
"speaker id", | ||
"language id", | ||
"node-addon-api", | ||
"streaming speech recognition", | ||
"speech", | ||
"recognition" | ||
], | ||
"author": "The next-gen Kaldi team", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/k2-fsa/sherpa-onnx/issues" | ||
}, | ||
"homepage": "https://github.com/k2-fsa/sherpa-onnx#readme", | ||
"optionalDependencies": { | ||
"sherpa-onnx-darwin-arm64": "^SHERPA_ONNX_VERSION", | ||
"sherpa-onnx-darwin-x64": "^SHERPA_ONNX_VERSION", | ||
"sherpa-onnx-linux-x64": "^SHERPA_ONNX_VERSION", | ||
"sherpa-onnx-linux-arm64": "^SHERPA_ONNX_VERSION", | ||
"sherpa-onnx-win-x64": "^SHERPA_ONNX_VERSION" | ||
} | ||
} |
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,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
sherpa_onnx_dir=$PWD | ||
echo "sherpa_onnx_dir: $sherpa_onnx_dir" | ||
|
||
src_dir=$sherpa_onnx_dir/.github/scripts/node-addon | ||
|
||
platform=$(node -p "require('os').platform()") | ||
|
||
arch=$(node -p "require('os').arch()") | ||
|
||
platform2=$platform | ||
|
||
if [[ $platform == win32 ]]; then | ||
platform2=win | ||
fi | ||
|
||
SHERPA_ONNX_VERSION=$(grep "SHERPA_ONNX_VERSION" ./CMakeLists.txt | cut -d " " -f 2 | cut -d '"' -f 2) | ||
echo "SHERPA_ONNX_VERSION $SHERPA_ONNX_VERSION" | ||
|
||
if [ -z $owner ]; then | ||
owner=k2-fsa | ||
fi | ||
|
||
sed -i.bak s/SHERPA_ONNX_VERSION/$SHERPA_ONNX_VERSION/g $src_dir/package-optional.json | ||
sed -i.bak s/k2-fsa/$owner/g $src_dir/package-optional.json | ||
sed -i.bak s/PLATFORM2/$platform2/g $src_dir/package-optional.json | ||
sed -i.bak s/PLATFORM/$platform/g $src_dir/package-optional.json | ||
sed -i.bak s/ARCH/$arch/g $src_dir/package-optional.json | ||
|
||
git diff $src_dir/package-optional.json | ||
|
||
dst=$sherpa_onnx_dir/sherpa-onnx-node | ||
mkdir -p $dst | ||
|
||
cp $src_dir/package-optional.json $dst/package.json | ||
cp $src_dir/index.js $dst/ | ||
cp $src_dir/README-optional.md $dst/README.md | ||
|
||
cp -fv build/install/lib/lib* $dst/ || true | ||
cp -fv build/install/lib/*dll $dst/ || true | ||
|
||
cp scripts/node-addon-api/build/Release/sherpa-onnx.node $dst/ | ||
|
||
ls $dst |
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,24 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
d=nodejs-addon-examples | ||
echo "dir: $d" | ||
cd $d | ||
npm install --verbose | ||
git status | ||
ls -lh | ||
ls -lh node_modules | ||
|
||
export DYLD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-darwin-x64:$DYLD_LIBRARY_PATH | ||
export DYLD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-darwin-arm64:$DYLD_LIBRARY_PATH | ||
export LD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-linux-x64:$LD_LIBRARY_PATH | ||
export LD_LIBRARY_PATH=$PWD/node_modules/sherpa-onnx-linux-arm64:$LD_LIBRARY_PATH | ||
|
||
curl -SL -O 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_asr_streaming_transducer.js | ||
|
||
rm -rf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 |
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
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 |
---|---|---|
|
@@ -57,6 +57,7 @@ jobs: | |
./build-android-arm64-v8a.sh | ||
mkdir -p jniLibs/arm64-v8a/ | ||
cp -v ./build-android-arm64-v8a/install/lib/*.so ./jniLibs/arm64-v8a/ | ||
rm -rf ./build-android-arm64-v8a/ | ||
- name: build android armv7-eabi | ||
shell: bash | ||
|
@@ -65,6 +66,7 @@ jobs: | |
./build-android-armv7-eabi.sh | ||
mkdir -p ./jniLibs/armeabi-v7a/ | ||
cp -v ./build-android-armv7-eabi/install/lib/*.so ./jniLibs/armeabi-v7a/ | ||
rm -rf ./build-android-armv7-eabi | ||
- name: build android x86_64 | ||
shell: bash | ||
|
@@ -73,6 +75,7 @@ jobs: | |
./build-android-x86-64.sh | ||
mkdir -p ./jniLibs/x86_64 | ||
cp -v ./build-android-x86-64/install/lib/*.so ./jniLibs/x86_64 | ||
rm -rf ./build-android-x86-64 | ||
- name: build android x86 | ||
shell: bash | ||
|
@@ -81,6 +84,7 @@ jobs: | |
./build-android-x86.sh | ||
mkdir -p ./jniLibs/x86 | ||
cp -v ./build-android-x86/install/lib/*.so ./jniLibs/x86 | ||
rm -rf ./build-android-x86 | ||
- name: Copy files | ||
shell: bash | ||
|
@@ -112,6 +116,8 @@ jobs: | |
command: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Fangjun Kuang" | ||
du -h -d1 . | ||
ls -lh | ||
rm -rf huggingface | ||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-libs huggingface | ||
|
Oops, something went wrong.