Support streaming conformer CTC models from wenet (#427)
This commit is contained in:
55
.github/scripts/test-online-ctc.sh
vendored
Executable file
55
.github/scripts/test-online-ctc.sh
vendored
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
log() {
|
||||
# This function is from espnet
|
||||
local fname=${BASH_SOURCE[1]##*/}
|
||||
echo -e "$(date '+%Y-%m-%d %H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*"
|
||||
}
|
||||
|
||||
echo "EXE is $EXE"
|
||||
echo "PATH: $PATH"
|
||||
|
||||
which $EXE
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run streaming Conformer CTC from WeNet"
|
||||
log "------------------------------------------------------------"
|
||||
wenet_models=(
|
||||
sherpa-onnx-zh-wenet-aishell
|
||||
sherpa-onnx-zh-wenet-aishell2
|
||||
sherpa-onnx-zh-wenet-wenetspeech
|
||||
sherpa-onnx-zh-wenet-multi-cn
|
||||
sherpa-onnx-en-wenet-librispeech
|
||||
sherpa-onnx-en-wenet-gigaspeech
|
||||
)
|
||||
for name in ${wenet_models[@]}; do
|
||||
repo_url=https://huggingface.co/csukuangfj/$name
|
||||
log "Start testing ${repo_url}"
|
||||
repo=$(basename $repo_url)
|
||||
log "Download pretrained model and test-data from $repo_url"
|
||||
GIT_LFS_SKIP_SMUDGE=1 git clone $repo_url
|
||||
pushd $repo
|
||||
git lfs pull --include "*.onnx"
|
||||
ls -lh *.onnx
|
||||
popd
|
||||
|
||||
log "test float32 models"
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--wenet-ctc-model=$repo/model-streaming.onnx \
|
||||
$repo/test_wavs/0.wav \
|
||||
$repo/test_wavs/1.wav \
|
||||
$repo/test_wavs/8k.wav
|
||||
|
||||
log "test int8 models"
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--wenet-ctc-model=$repo/model-streaming.int8.onnx \
|
||||
$repo/test_wavs/0.wav \
|
||||
$repo/test_wavs/1.wav \
|
||||
$repo/test_wavs/8k.wav
|
||||
|
||||
rm -rf $repo
|
||||
done
|
||||
11
.github/workflows/linux-gpu.yaml
vendored
11
.github/workflows/linux-gpu.yaml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -27,6 +28,8 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -88,6 +91,14 @@ jobs:
|
||||
file build/bin/sherpa-onnx
|
||||
readelf -d build/bin/sherpa-onnx
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx
|
||||
|
||||
.github/scripts/test-online-ctc.sh
|
||||
|
||||
- name: Test offline TTS
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
10
.github/workflows/linux.yaml
vendored
10
.github/workflows/linux.yaml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -27,6 +28,7 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -89,6 +91,14 @@ jobs:
|
||||
file build/bin/sherpa-onnx
|
||||
readelf -d build/bin/sherpa-onnx
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx
|
||||
|
||||
.github/scripts/test-online-ctc.sh
|
||||
|
||||
- name: Test offline CTC
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
11
.github/workflows/macos.yaml
vendored
11
.github/workflows/macos.yaml
vendored
@@ -13,6 +13,7 @@ on:
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -26,6 +27,7 @@ on:
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -96,6 +98,15 @@ jobs:
|
||||
otool -L build/bin/sherpa-onnx
|
||||
otool -l build/bin/sherpa-onnx
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin:$PATH
|
||||
export EXE=sherpa-onnx
|
||||
|
||||
.github/scripts/test-online-ctc.sh
|
||||
|
||||
|
||||
- name: Test offline TTS
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
10
.github/workflows/windows-x64-cuda.yaml
vendored
10
.github/workflows/windows-x64-cuda.yaml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -25,6 +26,7 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -66,6 +68,14 @@ jobs:
|
||||
|
||||
ls -lh ./bin/Release/sherpa-onnx.exe
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin/Release:$PATH
|
||||
export EXE=sherpa-onnx.exe
|
||||
|
||||
.github/scripts/test-online-ctc.sh
|
||||
|
||||
- name: Test offline TTS
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
10
.github/workflows/windows-x64.yaml
vendored
10
.github/workflows/windows-x64.yaml
vendored
@@ -12,6 +12,7 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -25,6 +26,7 @@ on:
|
||||
- '.github/scripts/test-online-paraformer.sh'
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
@@ -67,6 +69,14 @@ jobs:
|
||||
|
||||
ls -lh ./bin/Release/sherpa-onnx.exe
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin/Release:$PATH
|
||||
export EXE=sherpa-onnx.exe
|
||||
|
||||
.github/scripts/test-online-ctc.sh
|
||||
|
||||
- name: Test offline TTS
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
10
.github/workflows/windows-x86.yaml
vendored
10
.github/workflows/windows-x86.yaml
vendored
@@ -13,6 +13,7 @@ on:
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -26,6 +27,7 @@ on:
|
||||
- '.github/scripts/test-offline-transducer.sh'
|
||||
- '.github/scripts/test-offline-ctc.sh'
|
||||
- '.github/scripts/test-offline-tts.sh'
|
||||
- '.github/scripts/test-online-ctc.sh'
|
||||
- 'CMakeLists.txt'
|
||||
- 'cmake/**'
|
||||
- 'sherpa-onnx/csrc/*'
|
||||
@@ -67,6 +69,14 @@ jobs:
|
||||
|
||||
ls -lh ./bin/Release/sherpa-onnx.exe
|
||||
|
||||
- name: Test online CTC
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=$PWD/build/bin/Release:$PATH
|
||||
export EXE=sherpa-onnx.exe
|
||||
|
||||
.github/scripts/test-online-ctc.sh
|
||||
|
||||
- name: Test offline TTS
|
||||
shell: bash
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user