Add C++ runtime for SenseVoice models (#1148)

This commit is contained in:
Fangjun Kuang
2024-07-18 22:54:18 +08:00
committed by GitHub
parent 3bae5c3fe5
commit 25f0a10468
34 changed files with 1160 additions and 39 deletions

View File

@@ -15,7 +15,30 @@ echo "PATH: $PATH"
which $EXE
if false; then
log "------------------------------------------------------------"
log "Run SenseVoice models"
log "------------------------------------------------------------"
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
tar xvf sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
rm sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
repo=sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17
for m in model.onnx model.int8.onnx; do
for w in zh en yue ja ko; do
for use_itn in 0 1; do
echo "$m $w $use_itn"
time $EXE \
--tokens=$repo/tokens.txt \
--sense-voice-model=$repo/$m \
--sense-voice-use-itn=$use_itn \
$repo/test_wavs/$w.wav
done
done
done
rm -rf $repo
if true; then
# It has problems with onnxruntime 1.18
log "------------------------------------------------------------"
log "Run Wenet models"

View File

@@ -10,6 +10,18 @@ log() {
export GIT_CLONE_PROTECTION_ACTIVE=false
log "test offline SenseVoice CTC"
url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-sense-voice-zh-en-ja-ko-yue-2024-07-17.tar.bz2
name=$(basename $url)
repo=$(basename -s .tar.bz2 $name)
curl -SL -O $url
tar xvf $name
rm $name
ls -lh $repo
python3 ./python-api-examples/offline-sense-voice-ctc-decode-files.py
rm -rf $repo
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)