-
Notifications
You must be signed in to change notification settings - Fork 532
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
1 parent
6d80056
commit e033dcc
Showing
2 changed files
with
66 additions
and
0 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,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 |
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