Test int8 models (#107)
* Test int8 models * Fix displaying help messages * small fixes * Fix jni test
This commit is contained in:
74
.github/scripts/test-online-transducer.sh
vendored
74
.github/scripts/test-online-transducer.sh
vendored
@@ -25,12 +25,13 @@ 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
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/1089-134686-0001.wav
|
||||
$repo/test_wavs/1221-135766-0001.wav
|
||||
$repo/test_wavs/1221-135766-0002.wav
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
@@ -43,6 +44,16 @@ for wave in ${waves[@]}; do
|
||||
2
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
$repo/tokens.txt \
|
||||
$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/decoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
$wave \
|
||||
2
|
||||
done
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
@@ -57,12 +68,13 @@ 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
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/2.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
@@ -75,6 +87,16 @@ for wave in ${waves[@]}; do
|
||||
2
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
$repo/tokens.txt \
|
||||
$repo/encoder-epoch-11-avg-1.int8.onnx \
|
||||
$repo/decoder-epoch-11-avg-1.int8.onnx \
|
||||
$repo/joiner-epoch-11-avg-1.int8.onnx \
|
||||
$wave \
|
||||
2
|
||||
done
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
@@ -89,12 +111,13 @@ 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
|
||||
|
||||
waves=(
|
||||
$repo/test_wavs/1089-134686-0001.wav
|
||||
$repo/test_wavs/1221-135766-0001.wav
|
||||
$repo/test_wavs/1221-135766-0002.wav
|
||||
$repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
@@ -107,10 +130,22 @@ for wave in ${waves[@]}; do
|
||||
2
|
||||
done
|
||||
|
||||
# test int8
|
||||
#
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
$repo/tokens.txt \
|
||||
$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/decoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
$wave \
|
||||
2
|
||||
done
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run streaming Zipformer transducer (Bilingual, Chinse + English)"
|
||||
log "Run streaming Zipformer transducer (Bilingual, Chinese + English)"
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
repo_url=https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20
|
||||
@@ -121,6 +156,7 @@ 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
|
||||
|
||||
waves=(
|
||||
@@ -128,7 +164,7 @@ $repo/test_wavs/0.wav
|
||||
$repo/test_wavs/1.wav
|
||||
$repo/test_wavs/2.wav
|
||||
$repo/test_wavs/3.wav
|
||||
$repo/test_wavs/4.wav
|
||||
$repo/test_wavs/8k.wav
|
||||
)
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
@@ -141,6 +177,16 @@ for wave in ${waves[@]}; do
|
||||
2
|
||||
done
|
||||
|
||||
for wave in ${waves[@]}; do
|
||||
time $EXE \
|
||||
$repo/tokens.txt \
|
||||
$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/decoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
$wave \
|
||||
2
|
||||
done
|
||||
|
||||
# Decode a URL
|
||||
if [ $EXE == "sherpa-onnx-ffmpeg" ]; then
|
||||
time $EXE \
|
||||
@@ -152,4 +198,14 @@ if [ $EXE == "sherpa-onnx-ffmpeg" ]; then
|
||||
2
|
||||
fi
|
||||
|
||||
if [ $EXE == "sherpa-onnx-ffmpeg" ]; then
|
||||
time $EXE \
|
||||
$repo/tokens.txt \
|
||||
$repo/encoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/decoder-epoch-99-avg-1.int8.onnx \
|
||||
$repo/joiner-epoch-99-avg-1.int8.onnx \
|
||||
https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20/resolve/main/test_wavs/4.wav \
|
||||
2
|
||||
fi
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
Reference in New Issue
Block a user