Support onnxruntime 1.18.0 (#906)
This commit is contained in:
8
.github/scripts/test-nodejs-addon-npm.sh
vendored
8
.github/scripts/test-nodejs-addon-npm.sh
vendored
@@ -121,9 +121,9 @@ rm sherpa-onnx-nemo-fast-conformer-ctc-be-de-en-es-fr-hr-it-pl-ru-uk-20k.tar.bz2
|
||||
node ./test_asr_non_streaming_nemo_ctc.js
|
||||
rm -rf sherpa-onnx-nemo-fast-conformer-ctc-be-de-en-es-fr-hr-it-pl-ru-uk-20k
|
||||
|
||||
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
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
|
||||
node ./test_asr_non_streaming_paraformer.js
|
||||
|
||||
@@ -134,7 +134,7 @@ curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/i
|
||||
|
||||
node ./test_asr_non_streaming_paraformer_itn.js
|
||||
|
||||
rm -rf sherpa-onnx-paraformer-zh-2023-03-28
|
||||
rm -rf sherpa-onnx-paraformer-zh-2023-09-14
|
||||
|
||||
echo "----------tts----------"
|
||||
|
||||
|
||||
16
.github/scripts/test-nodejs-npm.sh
vendored
16
.github/scripts/test-nodejs-npm.sh
vendored
@@ -11,16 +11,16 @@ ls -lh node_modules
|
||||
|
||||
# offline asr
|
||||
|
||||
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
ls -lh
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
|
||||
rm -f itn*
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn-zh-number.wav
|
||||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/itn_zh_number.fst
|
||||
node ./test-offline-paraformer-itn.js
|
||||
rm -rf sherpa-onnx-paraformer-zh-2023-03-28
|
||||
rm -rf sherpa-onnx-paraformer-zh-2023-09-14
|
||||
|
||||
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-ctc-en-conformer-small.tar.bz2
|
||||
ls -lh
|
||||
@@ -29,12 +29,12 @@ rm sherpa-onnx-nemo-ctc-en-conformer-small.tar.bz2
|
||||
node ./test-offline-nemo-ctc.js
|
||||
rm -rf sherpa-onnx-nemo-ctc-en-conformer-small
|
||||
|
||||
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
ls -lh
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
node ./test-offline-paraformer.js
|
||||
rm -rf sherpa-onnx-paraformer-zh-2023-03-28
|
||||
rm -rf sherpa-onnx-paraformer-zh-2023-09-14
|
||||
|
||||
curl -LS -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-zipformer-en-2023-06-26.tar.bz2
|
||||
ls -lh
|
||||
|
||||
80
.github/scripts/test-offline-ctc.sh
vendored
80
.github/scripts/test-offline-ctc.sh
vendored
@@ -15,6 +15,49 @@ echo "PATH: $PATH"
|
||||
|
||||
which $EXE
|
||||
|
||||
if false; then
|
||||
# It has problems with onnxruntime 1.18
|
||||
log "------------------------------------------------------------"
|
||||
log "Run Wenet models"
|
||||
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://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/$name.tar.bz2
|
||||
log "Start testing ${repo_url}"
|
||||
repo=$name
|
||||
log "Download pretrained model and test-data from $repo_url"
|
||||
curl -SL -O $repo_url
|
||||
tar xvf $name.tar.bz2
|
||||
rm $name.tar.bz2
|
||||
|
||||
log "test float32 models"
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--wenet-ctc-model=$repo/model.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.int8.onnx \
|
||||
$repo/test_wavs/0.wav \
|
||||
$repo/test_wavs/1.wav \
|
||||
$repo/test_wavs/8k.wav
|
||||
|
||||
rm -rf $repo
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
log "test offline TeleSpeech CTC"
|
||||
url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-telespeech-ctc-int8-zh-2024-06-04.tar.bz2
|
||||
name=$(basename $url)
|
||||
@@ -145,44 +188,7 @@ done
|
||||
|
||||
rm -rf $repo
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run Wenet models"
|
||||
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://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/$name.tar.bz2
|
||||
log "Start testing ${repo_url}"
|
||||
repo=$name
|
||||
log "Download pretrained model and test-data from $repo_url"
|
||||
curl -SL -O $repo_url
|
||||
tar xvf $name.tar.bz2
|
||||
rm $name.tar.bz2
|
||||
|
||||
log "test float32 models"
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--wenet-ctc-model=$repo/model.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.int8.onnx \
|
||||
$repo/test_wavs/0.wav \
|
||||
$repo/test_wavs/1.wav \
|
||||
$repo/test_wavs/8k.wav
|
||||
|
||||
rm -rf $repo
|
||||
done
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run tdnn yesno (Hebrew)"
|
||||
|
||||
36
.github/scripts/test-offline-transducer.sh
vendored
36
.github/scripts/test-offline-transducer.sh
vendored
@@ -184,35 +184,13 @@ rm -rf $repo
|
||||
log "------------------------------------------------------------"
|
||||
log "Run Paraformer (Chinese)"
|
||||
log "------------------------------------------------------------"
|
||||
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
curl -SL -O $repo_url
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
repo=sherpa-onnx-paraformer-zh-2023-03-28
|
||||
log "Start testing ${repo_url}"
|
||||
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--paraformer=$repo/model.onnx \
|
||||
--num-threads=2 \
|
||||
--decoding-method=greedy_search \
|
||||
$repo/test_wavs/0.wav \
|
||||
$repo/test_wavs/1.wav \
|
||||
$repo/test_wavs/2.wav \
|
||||
$repo/test_wavs/8k.wav
|
||||
|
||||
time $EXE \
|
||||
--tokens=$repo/tokens.txt \
|
||||
--paraformer=$repo/model.int8.onnx \
|
||||
--num-threads=2 \
|
||||
--decoding-method=greedy_search \
|
||||
$repo/test_wavs/0.wav \
|
||||
$repo/test_wavs/1.wav \
|
||||
$repo/test_wavs/2.wav \
|
||||
$repo/test_wavs/8k.wav
|
||||
|
||||
rm -rf $repo
|
||||
# For onnxruntime 1.18.0, sherpa-onnx-paraformer-zh-2023-03-28 throws the following error
|
||||
# libc++abi: terminating with uncaught exception of type Ort::Exception: Node (Loop_5471)
|
||||
# Op (Loop) [TypeInferenceError] Graph attribute inferencing failed: Node (Concat_5490)
|
||||
# Op (Concat) [ShapeInferenceError] All inputs to Concat must have same rank. Input 1 has rank 2 != 1
|
||||
#
|
||||
# See https://github.com/microsoft/onnxruntime/issues/8115
|
||||
# We need to re-export this model using a recent version of onnxruntime and onnx
|
||||
|
||||
log "------------------------------------------------------------"
|
||||
log "Run Paraformer (Chinese) with timestamps"
|
||||
|
||||
10
.github/scripts/test-python.sh
vendored
10
.github/scripts/test-python.sh
vendored
@@ -312,13 +312,13 @@ log "Test non-streaming paraformer models"
|
||||
if [[ x$OS != x'windows-latest' ]]; then
|
||||
echo "OS: $OS"
|
||||
pushd $dir
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
curl -SL -O $repo_url
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-03-28.tar.bz2
|
||||
tar xvf sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
rm sherpa-onnx-paraformer-zh-2023-09-14.tar.bz2
|
||||
|
||||
log "Start testing ${repo_url}"
|
||||
repo=$dir/sherpa-onnx-paraformer-zh-2023-03-28
|
||||
repo=$dir/sherpa-onnx-paraformer-zh-2023-09-14
|
||||
|
||||
ls -lh $repo
|
||||
popd
|
||||
@@ -348,7 +348,7 @@ if [[ x$OS != x'windows-latest' ]]; then
|
||||
|
||||
python3 ./python-api-examples/inverse-text-normalization-offline-asr.py
|
||||
|
||||
rm -rfv sherpa-onnx-paraformer-zh-2023-03-28
|
||||
rm -rfv sherpa-onnx-paraformer-zh-2023-09-14
|
||||
|
||||
rm -rf $repo
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user