diff --git a/.github/workflows/test-dot-net-nuget.yaml b/.github/workflows/test-dot-net-nuget.yaml index b162e2b1..6a40a7e8 100644 --- a/.github/workflows/test-dot-net-nuget.yaml +++ b/.github/workflows/test-dot-net-nuget.yaml @@ -53,6 +53,7 @@ jobs: ./run-nemo-ctc.sh ./run-paraformer.sh ./run-zipformer.sh + ./run-hotwords.sh ./run-whisper.sh ./run-tdnn-yesno.sh diff --git a/.github/workflows/test-dot-net.yaml b/.github/workflows/test-dot-net.yaml index 6a133add..b3d7d8f7 100644 --- a/.github/workflows/test-dot-net.yaml +++ b/.github/workflows/test-dot-net.yaml @@ -194,6 +194,7 @@ jobs: ./run-nemo-ctc.sh ./run-paraformer.sh ./run-zipformer.sh + ./run-hotwords.sh ./run-whisper.sh ./run-tdnn-yesno.sh diff --git a/dotnet-examples/offline-decode-files/run-hotwords.sh b/dotnet-examples/offline-decode-files/run-hotwords.sh new file mode 100755 index 00000000..bfa1dfc0 --- /dev/null +++ b/dotnet-examples/offline-decode-files/run-hotwords.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -ex + +if [ ! -d ./sherpa-onnx-zipformer-en-2023-04-01 ]; then + wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-en-2023-04-01.tar.bz2 + tar xvf sherpa-onnx-zipformer-en-2023-04-01.tar.bz2 + rm sherpa-onnx-zipformer-en-2023-04-01.tar.bz2 +fi + +if [ ! -f ./sherpa-onnx-zipformer-en-2023-04-01/hotwords_en.txt ]; then +cat >./sherpa-onnx-zipformer-en-2023-04-01/hotwords_en.txt < QUARTERS +# 1.wav: FOR EVER -> FOREVER diff --git a/dotnet-examples/offline-decode-files/run-nemo-ctc.sh b/dotnet-examples/offline-decode-files/run-nemo-ctc.sh index dcfcf4f4..44e4ee0b 100755 --- a/dotnet-examples/offline-decode-files/run-nemo-ctc.sh +++ b/dotnet-examples/offline-decode-files/run-nemo-ctc.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -ex + if [ ! -d ./sherpa-onnx-nemo-ctc-en-conformer-medium ]; then GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-nemo-ctc-en-conformer-medium cd sherpa-onnx-nemo-ctc-en-conformer-medium diff --git a/dotnet-examples/offline-decode-files/run-paraformer.sh b/dotnet-examples/offline-decode-files/run-paraformer.sh index 9dff4574..4fb72f41 100755 --- a/dotnet-examples/offline-decode-files/run-paraformer.sh +++ b/dotnet-examples/offline-decode-files/run-paraformer.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -ex + if [ ! -d ./sherpa-onnx-paraformer-zh-2023-03-28 ]; then GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28 cd sherpa-onnx-paraformer-zh-2023-03-28 diff --git a/dotnet-examples/offline-decode-files/run-tdnn-yesno.sh b/dotnet-examples/offline-decode-files/run-tdnn-yesno.sh index 32d4a487..c2d8e9fd 100755 --- a/dotnet-examples/offline-decode-files/run-tdnn-yesno.sh +++ b/dotnet-examples/offline-decode-files/run-tdnn-yesno.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -ex + 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 diff --git a/dotnet-examples/offline-decode-files/run-whisper.sh b/dotnet-examples/offline-decode-files/run-whisper.sh index 8ac45282..6f5e26c6 100755 --- a/dotnet-examples/offline-decode-files/run-whisper.sh +++ b/dotnet-examples/offline-decode-files/run-whisper.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash +set -ex + 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 diff --git a/dotnet-examples/offline-decode-files/run-zipformer.sh b/dotnet-examples/offline-decode-files/run-zipformer.sh index 0bfb3641..6844307d 100755 --- a/dotnet-examples/offline-decode-files/run-zipformer.sh +++ b/dotnet-examples/offline-decode-files/run-zipformer.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash -# + +set -ex + if [ ! -d ./sherpa-onnx-zipformer-en-2023-04-01 ]; then - GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-en-2023-04-01 - cd sherpa-onnx-zipformer-en-2023-04-01 - git lfs pull --include "*.onnx" - cd .. + wget https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-en-2023-04-01.tar.bz2 + tar xvf sherpa-onnx-zipformer-en-2023-04-01.tar.bz2 + rm sherpa-onnx-zipformer-en-2023-04-01.tar.bz2 fi dotnet run \ diff --git a/dotnet-examples/offline-tts-play/run-piper.sh b/dotnet-examples/offline-tts-play/run-piper.sh new file mode 100755 index 00000000..ff639c57 --- /dev/null +++ b/dotnet-examples/offline-tts-play/run-piper.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -ex +if [ ! -f ./vits-piper-en_US-amy-low/en_US-amy-low.onnx ]; then + # wget -qq https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2 + curl -OL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2 + tar xf vits-piper-en_US-amy-low.tar.bz2 + rm vits-piper-en_US-amy-low.tar.bz2 +fi + +dotnet run \ + --vits-model=./vits-piper-en_US-amy-low/en_US-amy-low.onnx \ + --vits-tokens=./vits-piper-en_US-amy-low/tokens.txt \ + --vits-data-dir=./vits-piper-en_US-amy-low/espeak-ng-data \ + --debug=1 \ + --output-filename=./amy.wav \ + --text="This is a text to speech application in dotnet with Next Generation Kaldi" + diff --git a/dotnet-examples/offline-tts/run-aishell3.sh b/dotnet-examples/offline-tts/run-aishell3.sh index 7e5cc639..44e5e261 100755 --- a/dotnet-examples/offline-tts/run-aishell3.sh +++ b/dotnet-examples/offline-tts/run-aishell3.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +set -ex if [ ! -f ./vits-zh-aishell3/vits-aishell3.onnx ]; then # wget -qq https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-zh-aishell3.tar.bz2 curl -OL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-zh-aishell3.tar.bz2 diff --git a/dotnet-examples/offline-tts/run-piper.sh b/dotnet-examples/offline-tts/run-piper.sh index a2674091..ff639c57 100755 --- a/dotnet-examples/offline-tts/run-piper.sh +++ b/dotnet-examples/offline-tts/run-piper.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +set -ex if [ ! -f ./vits-piper-en_US-amy-low/en_US-amy-low.onnx ]; then # wget -qq https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2 curl -OL https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2 diff --git a/dotnet-examples/online-decode-files/run-paraformer.sh b/dotnet-examples/online-decode-files/run-paraformer.sh index 4200aee7..5731d013 100755 --- a/dotnet-examples/online-decode-files/run-paraformer.sh +++ b/dotnet-examples/online-decode-files/run-paraformer.sh @@ -4,6 +4,7 @@ # https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-streaming-paraformer-bilingual-zh-en-chinese-english # to download the model files +set -ex if [ ! -d ./sherpa-onnx-streaming-paraformer-bilingual-zh-en ]; then GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-paraformer-bilingual-zh-en cd sherpa-onnx-streaming-paraformer-bilingual-zh-en diff --git a/dotnet-examples/online-decode-files/run-transducer.sh b/dotnet-examples/online-decode-files/run-transducer.sh index 4023f1ad..06c478ba 100755 --- a/dotnet-examples/online-decode-files/run-transducer.sh +++ b/dotnet-examples/online-decode-files/run-transducer.sh @@ -4,6 +4,7 @@ # https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-transducer/zipformer-transducer-models.html#csukuangfj-sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20-bilingual-chinese-english # to download the model files +set -ex if [ ! -d ./sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 ]; then GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 cd sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 diff --git a/dotnet-examples/online-decode-files/run-zipformer2-ctc.sh b/dotnet-examples/online-decode-files/run-zipformer2-ctc.sh index 910b27f3..cfc0eb55 100755 --- a/dotnet-examples/online-decode-files/run-zipformer2-ctc.sh +++ b/dotnet-examples/online-decode-files/run-zipformer2-ctc.sh @@ -4,6 +4,7 @@ # https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-ctc/zipformer-ctc-models.html#sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13-chinese # to download the model files +set -ex if [ ! -d ./sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13 ]; then curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13.tar.bz2 tar xvf sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13.tar.bz2 diff --git a/dotnet-examples/speech-recognition-from-microphone/run-paraformer.sh b/dotnet-examples/speech-recognition-from-microphone/run-paraformer.sh index 5e774a55..ec4e15d7 100755 --- a/dotnet-examples/speech-recognition-from-microphone/run-paraformer.sh +++ b/dotnet-examples/speech-recognition-from-microphone/run-paraformer.sh @@ -4,6 +4,7 @@ # https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-streaming-paraformer-bilingual-zh-en-chinese-english # to download the model files +set -ex if [ ! -d ./sherpa-onnx-streaming-paraformer-bilingual-zh-en ]; then GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-paraformer-bilingual-zh-en cd sherpa-onnx-streaming-paraformer-bilingual-zh-en diff --git a/dotnet-examples/speech-recognition-from-microphone/run-transducer.sh b/dotnet-examples/speech-recognition-from-microphone/run-transducer.sh index 7d5fe0b5..1c1dc11a 100755 --- a/dotnet-examples/speech-recognition-from-microphone/run-transducer.sh +++ b/dotnet-examples/speech-recognition-from-microphone/run-transducer.sh @@ -4,6 +4,8 @@ # https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-transducer/zipformer-transducer-models.html#csukuangfj-sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20-bilingual-chinese-english # to download the model files # +set -ex + export LD_LIBRARY_PATH=$PWD:$LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=$PWD:$DYLD_LIBRARY_PATH