-
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.
Fix various language binding APIs for tdnn and whisper models (#278)
- Loading branch information
1 parent
3ab135c
commit e31f9e4
Showing
16 changed files
with
249 additions
and
14 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
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 |
---|---|---|
|
@@ -72,3 +72,5 @@ jobs: | |
./run-nemo-ctc.sh | ||
./run-paraformer.sh | ||
./run-zipformer.sh | ||
./run-whisper.sh | ||
./run-tdnn-yesno.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
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,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ ! -d ./sherpa-onnx-tdnn-yesno ]; then | ||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-tdnn-yesno | ||
cd sherpa-onnx-tdnn-yesno | ||
git lfs pull --include "*.onnx" | ||
cd .. | ||
fi | ||
|
||
dotnet run \ | ||
--sample-rate=8000 \ | ||
--feat-dim=23 \ | ||
--tokens=./sherpa-onnx-tdnn-yesno/tokens.txt \ | ||
--tdnn-model=./sherpa-onnx-tdnn-yesno/model-epoch-14-avg-2.onnx \ | ||
--files ./sherpa-onnx-tdnn-yesno/test_wavs/0_0_0_1_0_0_0_1.wav \ | ||
./sherpa-onnx-tdnn-yesno/test_wavs/0_0_1_0_0_0_1_0.wav \ | ||
./sherpa-onnx-tdnn-yesno/test_wavs/0_0_1_0_0_1_1_1.wav \ | ||
./sherpa-onnx-tdnn-yesno/test_wavs/0_0_1_0_1_0_0_1.wav \ | ||
./sherpa-onnx-tdnn-yesno/test_wavs/0_0_1_1_0_0_0_1.wav \ | ||
./sherpa-onnx-tdnn-yesno/test_wavs/0_0_1_1_0_1_1_0.wav |
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ ! -d ./sherpa-onnx-whisper-tiny.en ]; then | ||
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-whisper-tiny.en | ||
cd sherpa-onnx-whisper-tiny.en | ||
git lfs pull --include "*.onnx" | ||
cd .. | ||
fi | ||
|
||
dotnet run \ | ||
--num-threads=2 \ | ||
--whisper-encoder=./sherpa-onnx-whisper-tiny.en/tiny.en-encoder.onnx \ | ||
--whisper-decoder=./sherpa-onnx-whisper-tiny.en/tiny.en-decoder.onnx \ | ||
--tokens=./sherpa-onnx-whisper-tiny.en/tiny.en-tokens.txt \ | ||
--files ./sherpa-onnx-whisper-tiny.en/test_wavs/0.wav \ | ||
./sherpa-onnx-whisper-tiny.en/test_wavs/1.wav \ | ||
./sherpa-onnx-whisper-tiny.en/test_wavs/8k.wav |
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
14 changes: 14 additions & 0 deletions
14
go-api-examples/non-streaming-decode-files/run-tdnn-yesno.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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Please refer to | ||
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-ctc/yesno/index.html | ||
# to download the model | ||
# before you run this script. | ||
# | ||
|
||
./non-streaming-decode-files \ | ||
--sample-rate=8000 \ | ||
--feat-dim=23 \ | ||
--tokens=./sherpa-onnx-tdnn-yesno/tokens.txt \ | ||
--tdnn-model=./sherpa-onnx-tdnn-yesno/model-epoch-14-avg-2.onnx \ | ||
./sherpa-onnx-tdnn-yesno/test_wavs/0_0_0_1_0_0_0_1.wav |
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,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Please refer to | ||
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/whisper/tiny.en.html | ||
# to download the model | ||
# before you run this script. | ||
# | ||
# You can switch to a different offline model if you need | ||
|
||
./non-streaming-decode-files \ | ||
--whisper-encoder=./sherpa-onnx-whisper-tiny.en/tiny.en-encoder.onnx \ | ||
--whisper-decoder=./sherpa-onnx-whisper-tiny.en/tiny.en-decoder.onnx \ | ||
--tokens=./sherpa-onnx-whisper-tiny.en/tiny.en-tokens.txt \ | ||
./sherpa-onnx-whisper-tiny.en/test_wavs/0.wav | ||
|
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
Oops, something went wrong.