Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
xuning
/
sherpaonnx
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Fangjun Kuang
2024-05-21 11:50:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2024-05-21 11:50:13 +0800
Commit
fdcae56a1463695a68cec05349a10036f0622b21
fdcae56a
1 parent
b012b78c
Fix Go tests (#897)
显示空白字符变更
内嵌
并排对比
正在显示
27 个修改的文件
包含
159 行增加
和
173 行删除
.github/workflows/test-go-package.yaml
.github/workflows/test-go.yaml
go-api-examples/non-streaming-decode-files/main.go
go-api-examples/non-streaming-decode-files/run-nemo-ctc.sh
go-api-examples/non-streaming-decode-files/run-paraformer.sh
go-api-examples/non-streaming-decode-files/run-tdnn-yesno.sh
go-api-examples/non-streaming-decode-files/run-transducer.sh
go-api-examples/non-streaming-decode-files/run-whisper.sh
go-api-examples/non-streaming-tts/run-vits-ljs.sh
go-api-examples/non-streaming-tts/run-vits-piper-en_US-lessac-medium.sh
go-api-examples/non-streaming-tts/run-vits-vctk.sh
go-api-examples/non-streaming-tts/run-vits-zh-aishell3.sh
go-api-examples/real-time-speech-recognition-from-microphone/run.sh
go-api-examples/speaker-identification/run.sh
go-api-examples/streaming-decode-files/run-paraformer.sh
go-api-examples/streaming-decode-files/run-transducer.sh
go-api-examples/streaming-decode-files/run-zipformer2-ctc.sh
go-api-examples/vad-asr-paraformer/run.sh
go-api-examples/vad-asr-whisper/run.sh
go-api-examples/vad-speaker-identification/run.sh
go-api-examples/vad-spoken-language-identification/run.sh
go-api-examples/vad/run.sh
scripts/go/_internal/build_darwin_arm64.go
scripts/go/_internal/lib/aarch64-apple-darwin
scripts/go/_internal/non-streaming-decode-files/go.mod
scripts/go/_internal/real-time-speech-recognition-from-microphone/go.mod
scripts/go/_internal/streaming-decode-files/go.mod
.github/workflows/test-go-package.yaml
查看文件 @
fdcae56
...
...
@@ -149,27 +149,19 @@ jobs:
go build
ls -lh
git lfs install
echo "Test vits-ljs"
git clone https://huggingface.co/csukuangfj/vits-ljs
./run-vits-ljs.sh
rm -rf vits-ljs
echo "Test vits-vctk"
git clone https://huggingface.co/csukuangfj/vits-vctk
./run-vits-vctk.sh
rm -rf vits-vctk
echo "Test vits-icefall-zh-aishell3"
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
tar xvf vits-icefall-zh-aishell3.tar.bz2
rm vits-icefall-zh-aishell3.tar.bz2
./run-vits-zh-aishell3.sh
rm -rf vits-icefall-zh-aishell3
*
rm -rf vits-icefall-zh-aishell3
echo "Test vits-piper-en_US-lessac-medium"
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
./run-vits-piper-en_US-lessac-medium.sh
rm -rf vits-piper-en_US-lessac-medium
...
...
@@ -194,25 +186,19 @@ jobs:
cp -v /C/Users/runneradmin/go/pkg/mod/github.com/k2-fsa/sherpa-onnx-go-windows*/lib/x86_64-pc-windows-gnu/*.dll .
ls -lh
git lfs install
echo "Test vits-ljs"
git clone https://huggingface.co/csukuangfj/vits-ljs
./run-vits-ljs.sh
rm -rf vits-ljs
echo "Test vits-vctk"
git clone https://huggingface.co/csukuangfj/vits-vctk
./run-vits-vctk.sh
rm -rf vits-vctk
echo "Test vits-zh-aishell3"
git clone https://huggingface.co/csukuangfj/vits-zh-aishell3
./run-vits-zh-aishell3.sh
rm -rf vits-zh-aishell3
rm -rf vits-
icefall-
zh-aishell3
echo "Test vits-piper-en_US-lessac-medium"
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
./run-vits-piper-en_US-lessac-medium.sh
rm -rf vits-piper-en_US-lessac-medium
...
...
@@ -245,25 +231,19 @@ jobs:
cp -v /C/Users/runneradmin/go/pkg/mod/github.com/k2-fsa/sherpa-onnx-go-windows*/lib/i686-pc-windows-gnu/*.dll .
ls -lh
git lfs install
echo "Test vits-ljs"
git clone https://huggingface.co/csukuangfj/vits-ljs
./run-vits-ljs.sh
rm -rf vits-ljs
echo "Test vits-vctk"
git clone https://huggingface.co/csukuangfj/vits-vctk
./run-vits-vctk.sh
rm -rf vits-vctk
echo "Test vits-zh-aishell3"
git clone https://huggingface.co/csukuangfj/vits-zh-aishell3
./run-vits-zh-aishell3.sh
rm -rf vits-zh-aishell3
echo "Test vits-piper-en_US-lessac-medium"
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
./run-vits-piper-en_US-lessac-medium.sh
rm -rf vits-piper-en_US-lessac-medium
...
...
@@ -281,33 +261,23 @@ jobs:
go build
ls -lh
git lfs install
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28
./run-paraformer.sh
rm -rf sherpa-onnx-paraformer-zh-2023-03-28
echo "Test NeMo CTC"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-nemo-ctc-en-conformer-medium
./run-nemo-ctc.sh
rm -rf sherpa-onnx-nemo-ctc-en-conformer-medium
echo "Test Whisper tiny.en"
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 ..
./run-whisper.sh
rm -rf sherpa-onnx-whisper-tiny.en
echo "Test Tdnn yesno"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-tdnn-yesno
./run-tdnn-yesno.sh
rm -rf sherpa-onnx-tdnn-yesno
...
...
@@ -328,33 +298,23 @@ jobs:
cp -v /C/Users/runneradmin/go/pkg/mod/github.com/k2-fsa/sherpa-onnx-go-windows*/lib/x86_64-pc-windows-gnu/*.dll .
ls -lh
git lfs install
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28
./run-paraformer.sh
rm -rf sherpa-onnx-paraformer-zh-2023-03-28
echo "Test NeMo CTC"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-nemo-ctc-en-conformer-medium
./run-nemo-ctc.sh
rm -rf sherpa-onnx-nemo-ctc-en-conformer-medium
echo "Test Whisper tiny.en"
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 ..
./run-whisper.sh
rm -rf sherpa-onnx-whisper-tiny.en
echo "Test Tdnn yesno"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-tdnn-yesno
./run-tdnn-yesno.sh
rm -rf sherpa-onnx-tdnn-yesno
...
...
@@ -383,33 +343,23 @@ jobs:
cp -v /C/Users/runneradmin/go/pkg/mod/github.com/k2-fsa/sherpa-onnx-go-windows*/lib/i686-pc-windows-gnu/*.dll .
ls -lh
git lfs install
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28
./run-paraformer.sh
rm -rf sherpa-onnx-paraformer-zh-2023-03-28
echo "Test NeMo CTC"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-nemo-ctc-en-conformer-medium
./run-nemo-ctc.sh
rm -rf sherpa-onnx-nemo-ctc-en-conformer-medium
echo "Test Whisper tiny.en"
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 ..
./run-whisper.sh
rm -rf sherpa-onnx-whisper-tiny.en
echo "Test Tdnn yesno"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-tdnn-yesno
./run-tdnn-yesno.sh
rm -rf sherpa-onnx-tdnn-yesno
...
...
@@ -424,15 +374,11 @@ jobs:
go build
ls -lh
git lfs install
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-streaming-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-paraformer-bilingual-zh-en
./run-paraformer.sh
rm -rf sherpa-onnx-streaming-paraformer-bilingual-zh-en
...
...
@@ -453,15 +399,11 @@ jobs:
cp -v /C/Users/runneradmin/go/pkg/mod/github.com/k2-fsa/sherpa-onnx-go-windows*/lib/x86_64-pc-windows-gnu/*.dll .
ls -lh
git lfs install
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-streaming-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-paraformer-bilingual-zh-en
./run-paraformer.sh
rm -rf sherpa-onnx-streaming-paraformer-bilingual-zh-en
...
...
@@ -491,15 +433,11 @@ jobs:
cp -v /C/Users/runneradmin/go/pkg/mod/github.com/k2-fsa/sherpa-onnx-go-windows*/lib/i686-pc-windows-gnu/*.dll .
ls -lh
git lfs install
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-streaming-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-paraformer-bilingual-zh-en
./run-paraformer.sh
rm -rf sherpa-onnx-streaming-paraformer-bilingual-zh-en
...
...
.github/workflows/test-go.yaml
查看文件 @
fdcae56
...
...
@@ -59,6 +59,12 @@ jobs:
go version
go env GOPATH
go env GOARCH
go env CGO_ENABLED
-
name
:
Display go env
shell
:
bash
run
:
|
go env
-
name
:
Build sherpa-onnx
shell
:
bash
...
...
@@ -71,19 +77,24 @@ jobs:
cp -v _deps/onnxruntime-src/lib/libonnxruntime*dylib ./lib/
cd ../scripts/go/_internal/
ls -lh lib
echo "-----"
ls -lh lib/*/
echo "-----"
go mod tidy
go build
-
name
:
Test s
treaming HLG decoding
-
name
:
Test s
peaker identification
shell
:
bash
run
:
|
cd scripts/go/_internal/s
treaming-hlg-decoding
/
cd scripts/go/_internal/s
peaker-identification
/
./run.sh
-
name
:
Test s
peaker identification
-
name
:
Test s
treaming HLG decoding
shell
:
bash
run
:
|
cd scripts/go/_internal/s
peaker-identification
/
cd scripts/go/_internal/s
treaming-hlg-decoding
/
./run.sh
-
name
:
Test non-streaming TTS (macOS)
...
...
@@ -101,24 +112,18 @@ jobs:
git lfs install
echo "Test vits-ljs"
git clone https://huggingface.co/csukuangfj/vits-ljs
./run-vits-ljs.sh
rm -rf vits-ljs
echo "Test vits-vctk"
git clone https://huggingface.co/csukuangfj/vits-vctk
./run-vits-vctk.sh
rm -rf vits-vctk
echo "Test vits-zh-aishell3"
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
tar xvf vits-icefall-zh-aishell3.tar.bz2
rm vits-icefall-zh-aishell3.tar.bz2
./run-vits-zh-aishell3.sh
rm -rf vits-icefall-zh-aishell3
echo "Test vits-piper-en_US-lessac-medium"
git clone https://huggingface.co/csukuangfj/vits-piper-en_US-lessac-medium
./run-vits-piper-en_US-lessac-medium.sh
rm -rf vits-piper-en_US-lessac-medium
...
...
@@ -142,30 +147,22 @@ jobs:
git lfs install
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-paraformer-zh-2023-03-28
./run-paraformer.sh
rm -rf sherpa-onnx-paraformer-zh-2023-03-28
echo "Test NeMo CTC"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-nemo-ctc-en-conformer-medium
./run-nemo-ctc.sh
rm -rf sherpa-onnx-nemo-ctc-en-conformer-medium
echo "Test Whisper tiny.en"
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 ..
./run-whisper.sh
rm -rf sherpa-onnx-whisper-tiny.en
echo "Test Tdnn yesno"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-tdnn-yesno
./run-tdnn-yesno.sh
rm -rf sherpa-onnx-tdnn-yesno
...
...
@@ -179,22 +176,14 @@ jobs:
go build
ls -lh
git lfs install
echo "Test zipformer2 CTC"
wget -qq 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
rm sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13.tar.bz2
./run-zipformer2-ctc.sh
rm -rf sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13
echo "Test transducer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-06-26
./run-transducer.sh
rm -rf sherpa-onnx-streaming-zipformer-en-2023-06-26
echo "Test paraformer"
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-paraformer-bilingual-zh-en
./run-paraformer.sh
rm -rf sherpa-onnx-streaming-paraformer-bilingual-zh-en
...
...
go-api-examples/non-streaming-decode-files/main.go
查看文件 @
fdcae56
...
...
@@ -31,6 +31,7 @@ func main() {
flag
.
StringVar
(
&
config
.
ModelConfig
.
Whisper
.
Decoder
,
"whisper-decoder"
,
""
,
"Path to the whisper decoder model"
)
flag
.
StringVar
(
&
config
.
ModelConfig
.
Whisper
.
Language
,
"whisper-language"
,
""
,
"Language of the input wave. You can leave it empty "
)
flag
.
StringVar
(
&
config
.
ModelConfig
.
Whisper
.
Task
,
"whisper-task"
,
"transcribe"
,
"transcribe or translate"
)
flag
.
IntVar
(
&
config
.
ModelConfig
.
Whisper
.
TailPaddings
,
"whisper-tail-paddings"
,
-
1
,
"tail paddings for whisper"
)
flag
.
StringVar
(
&
config
.
ModelConfig
.
Tdnn
.
Model
,
"tdnn-model"
,
""
,
"Path to the tdnn model"
)
...
...
go-api-examples/non-streaming-decode-files/run-nemo-ctc.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# Please refer to
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-ctc/nemo/english.html#stt-en-conformer-ctc-medium
# to download the model
# before you run this script.
#
# You can switch to a different offline model if you need
set
-ex
if
[
! -d sherpa-onnx-nemo-ctc-en-conformer-medium
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-ctc-en-conformer-medium.tar.bz2
tar xvf sherpa-onnx-nemo-ctc-en-conformer-medium.tar.bz2
rm sherpa-onnx-nemo-ctc-en-conformer-medium.tar.bz2
fi
go mod tidy
go build
./non-streaming-decode-files
\
--nemo-ctc ./sherpa-onnx-nemo-ctc-en-conformer-medium/model.onnx
\
...
...
go-api-examples/non-streaming-decode-files/run-paraformer.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# Please refer to
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-paraformer/paraformer-models.html#csukuangfj-sherpa-onnx-paraformer-zh-2023-03-28-chinese
# to download the model
# before you run this script.
#
set
-ex
if
[
! -d sherpa-onnx-paraformer-zh-2023-03-28
]
;
then
curl -SL -O 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
fi
go mod tidy
go build
./non-streaming-decode-files
\
--paraformer ./sherpa-onnx-paraformer-zh-2023-03-28/model.int8.onnx
\
...
...
go-api-examples/non-streaming-decode-files/run-tdnn-yesno.sh
查看文件 @
fdcae56
#!/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.
#
set
-ex
if
[
! -d sherpa-onnx-tdnn-yesno
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-tdnn-yesno.tar.bz2
tar xvf sherpa-onnx-tdnn-yesno.tar.bz2
rm sherpa-onnx-tdnn-yesno.tar.bz2
fi
go mod tidy
go build
./non-streaming-decode-files
\
--sample-rate
=
8000
\
...
...
go-api-examples/non-streaming-decode-files/run-transducer.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# Please refer to
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/offline-transducer/zipformer-transducer-models.html#csukuangfj-sherpa-onnx-zipformer-en-2023-06-26-english
# to download the model
# before you run this script.
#
# You can switch to a different offline model if you need
set
-ex
if
[
! -d sherpa-onnx-streaming-zipformer-en-2023-06-26
]
;
then
curl -SL -O 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
fi
go mod tidy
go build
./non-streaming-decode-files
\
--encoder ./sherpa-onnx-zipformer-en-2023-06-26/encoder-epoch-99-avg-1.onnx
\
...
...
go-api-examples/non-streaming-decode-files/run-whisper.sh
查看文件 @
fdcae56
#!/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
set
-ex
if
[
! -d sherpa-onnx-whisper-tiny.en
]
;
then
curl -SL -O 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
fi
go mod tidy
go build
./non-streaming-decode-files
\
--whisper-encoder
=
./sherpa-onnx-whisper-tiny.en/tiny.en-encoder.onnx
\
...
...
go-api-examples/non-streaming-tts/run-vits-ljs.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# please refer to
# https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/vits.html#ljspeech-english-single-speaker
# to download the model before you run this script
set
-ex
if
[
! -d vits-ljs
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-ljs.tar.bz2
tar xvf vits-ljs.tar.bz2
rm vits-ljs.tar.bz2
fi
go mod tidy
go build
./non-streaming-tts
\
--vits-model
=
./vits-ljs/vits-ljs.onnx
\
...
...
go-api-examples/non-streaming-tts/run-vits-piper-en_US-lessac-medium.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# please refer to
# https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/vits.html#en-us-lessac-medium-english-single-speaker
# to download the model before you run this script
set
-ex
if
[
! -d vits-piper-en_US-lessac-medium
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-lessac-medium.tar.bz2
tar xvf vits-piper-en_US-lessac-medium.tar.bz2
rm vits-piper-en_US-lessac-medium.tar.bz2
fi
go mod tidy
go build
./non-streaming-tts
\
--vits-model
=
./vits-piper-en_US-lessac-medium/en_US-lessac-medium.onnx
\
...
...
go-api-examples/non-streaming-tts/run-vits-vctk.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# please refer to
# https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/vits.html#vctk-english-multi-speaker-109-speakers
# to download the model before you run this script
set
-ex
if
[
! -d vits-vctk
]
;
then
curl -SL -O 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
fi
go mod tidy
go build
for
sid
in
0 10 108;
do
./non-streaming-tts
\
...
...
go-api-examples/non-streaming-tts/run-vits-zh-aishell3.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
set
-ex
# please refer to
# https://k2-fsa.github.io/sherpa/onnx/tts/pretrained_models/vits.html#aishell3-chinese-multi-speaker-174-speakers
# to download the model before you run this script
if
[
! -d vits-icefall-zh-aishell3
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-icefall-zh-aishell3.tar.bz2
tar xvf vits-icefall-zh-aishell3.tar.bz2
rm vits-icefall-zh-aishell3.tar.bz2
fi
go mod tidy
go build
for
sid
in
10 33 99;
do
./non-streaming-tts
\
...
...
go-api-examples/real-time-speech-recognition-from-microphone/run.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# Please refer to
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-transducer/zipformer-transducer-models.html#pkufool-icefall-asr-zipformer-streaming-wenetspeech-20230615-chinese
# to download the model
# before you run this script.
#
# You can switch to different online models if you need
set
-ex
if
[
! -d icefall-asr-zipformer-streaming-wenetspeech-20230615
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2
tar xvf icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2
rm icefall-asr-zipformer-streaming-wenetspeech-20230615.tar.bz2
fi
go mod tidy
go build
./real-time-speech-recognition-from-microphone
\
--encoder ./icefall-asr-zipformer-streaming-wenetspeech-20230615/exp/encoder-epoch-12-avg-4-chunk-16-left-128.onnx
\
...
...
go-api-examples/speaker-identification/run.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
set
-ex
if
[
! -f ./3dspeaker_speech_campplus_sv_zh-cn_16k-common.onnx
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/3dspeaker_speech_campplus_sv_zh-cn_16k-common.onnx
fi
...
...
go-api-examples/streaming-decode-files/run-paraformer.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# Please refer to
# 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
git lfs pull --include
"*.onnx"
cd
..
curl -SL -O 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
fi
go mod tidy
go build
./streaming-decode-files
\
--paraformer-encoder ./sherpa-onnx-streaming-paraformer-bilingual-zh-en/encoder.int8.onnx
\
--paraformer-decoder ./sherpa-onnx-streaming-paraformer-bilingual-zh-en/decoder.int8.onnx
\
...
...
go-api-examples/streaming-decode-files/run-transducer.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# Please refer to
# https://k2-fsa.github.io/sherpa/onnx/pretrained_models/online-transducer/zipformer-transducer-models.html#csukuangfj-sherpa-onnx-streaming-zipformer-en-2023-06-26-english
# to download the model
# before you run this script.
#
# You can switch to a different online model if you need
set
-ex
if
[
! -d sherpa-onnx-streaming-zipformer-en-2023-06-26
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-en-2023-06-26.tar.bz2
tar xvf sherpa-onnx-streaming-zipformer-en-2023-06-26.tar.bz2
rm sherpa-onnx-streaming-zipformer-en-2023-06-26.tar.bz2
fi
go mod tidy
go build
./streaming-decode-files
\
--encoder ./sherpa-onnx-streaming-zipformer-en-2023-06-26/encoder-epoch-99-avg-1-chunk-16-left-128.onnx
\
...
...
go-api-examples/streaming-decode-files/run-zipformer2-ctc.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
# Please refer to
# 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
# before you run this script.
#
# You can switch to a different online model if you need
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
rm sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13.tar.bz2
fi
go mod tidy
go build
./streaming-decode-files
\
--zipformer2-ctc ./sherpa-onnx-streaming-zipformer-ctc-multi-zh-hans-2023-12-13/ctc-epoch-20-avg-1-chunk-16-left-128.onnx
\
...
...
go-api-examples/vad-asr-paraformer/run.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
set
-ex
if
[
! -f ./silero_vad.onnx
]
;
then
curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx
...
...
go-api-examples/vad-asr-whisper/run.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
set
-ex
if
[
! -f ./silero_vad.onnx
]
;
then
curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx
...
...
go-api-examples/vad-speaker-identification/run.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
set
-ex
if
[
! -f ./3dspeaker_speech_campplus_sv_zh-cn_16k-common.onnx
]
;
then
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/speaker-recongition-models/3dspeaker_speech_campplus_sv_zh-cn_16k-common.onnx
fi
...
...
go-api-examples/vad-spoken-language-identification/run.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
set
-ex
if
[
! -f ./silero_vad.onnx
]
;
then
curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx
...
...
go-api-examples/vad/run.sh
查看文件 @
fdcae56
#!/usr/bin/env bash
set
-ex
if
[
! -f ./silero_vad.onnx
]
;
then
curl -SL -O https://github.com/snakers4/silero-vad/raw/master/files/silero_vad.onnx
...
...
scripts/go/_internal/build_darwin_arm64.go
0 → 100644
查看文件 @
fdcae56
//go:build darwin && arm64 && !ios
package
sherpa_onnx
// #cgo LDFLAGS: -L ${SRCDIR}/lib/aarch64-apple-darwin -lsherpa-onnx-c-api -lsherpa-onnx-core -lkaldi-native-fbank-core -lkaldi-decoder-core -lsherpa-onnx-kaldifst-core -lsherpa-onnx-fstfar -lsherpa-onnx-fst -lpiper_phonemize -lespeak-ng -lucd -lonnxruntime -Wl,-rpath,${SRCDIR}/lib/aarch64-apple-darwin
import
"C"
...
...
scripts/go/_internal/lib/aarch64-apple-darwin
0 → 120000
查看文件 @
fdcae56
../../../../build/lib
\ No newline at end of file
...
...
scripts/go/_internal/non-streaming-decode-files/go.mod
查看文件 @
fdcae56
...
...
@@ -3,9 +3,3 @@ module non-streaming-decode-files
go 1.12
replace github.com/k2-fsa/sherpa-onnx-go/sherpa_onnx => ../
require (
github.com/k2-fsa/sherpa-onnx-go/sherpa_onnx v0.0.0-00010101000000-000000000000
github.com/spf13/pflag v1.0.5
github.com/youpy/go-wav v0.3.2
)
...
...
scripts/go/_internal/real-time-speech-recognition-from-microphone/go.mod
查看文件 @
fdcae56
...
...
@@ -3,9 +3,3 @@ module real-time-speech-recognition-from-microphone
go 1.12
replace github.com/k2-fsa/sherpa-onnx-go/sherpa_onnx => ../
require (
github.com/gordonklaus/portaudio v0.0.0-20230709114228-aafa478834f5
github.com/k2-fsa/sherpa-onnx-go/sherpa_onnx v0.0.0-00010101000000-000000000000
github.com/spf13/pflag v1.0.5
)
...
...
scripts/go/_internal/streaming-decode-files/go.mod
查看文件 @
fdcae56
...
...
@@ -3,9 +3,3 @@ module streaming-decode-files
go 1.12
replace github.com/k2-fsa/sherpa-onnx-go/sherpa_onnx => ../
require (
github.com/k2-fsa/sherpa-onnx-go/sherpa_onnx v0.0.0-00010101000000-000000000000
github.com/spf13/pflag v1.0.5
github.com/youpy/go-wav v0.3.2
)
...
...
请
注册
或
登录
后发表评论