forked from k2-fsa/sherpa-onnx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # ios-swift/.gitignore
- Loading branch information
Showing
436 changed files
with
14,307 additions
and
1,186 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,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
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 "CXX_STREAMING_ZIPFORMER_EXE is $CXX_STREAMING_ZIPFORMER_EXE" | ||
echo "CXX_WHISPER_EXE is $CXX_WHISPER_EXE" | ||
echo "CXX_SENSE_VOICE_EXE is $CXX_SENSE_VOICE_EXE" | ||
echo "PATH: $PATH" | ||
|
||
log "------------------------------------------------------------" | ||
log "Test streaming zipformer CXX API" | ||
log "------------------------------------------------------------" | ||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | ||
tar xvf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | ||
rm sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20.tar.bz2 | ||
$CXX_STREAMING_ZIPFORMER_EXE | ||
rm -rf sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 | ||
|
||
log "------------------------------------------------------------" | ||
log "Test Whisper CXX API" | ||
log "------------------------------------------------------------" | ||
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-tiny.en.tar.bz2 | ||
tar xvf sherpa-onnx-whisper-tiny.en.tar.bz2 | ||
rm sherpa-onnx-whisper-tiny.en.tar.bz2 | ||
$CXX_WHISPER_EXE | ||
rm -rf sherpa-onnx-whisper-tiny.en | ||
|
||
log "------------------------------------------------------------" | ||
log "Test SenseVoice CXX API" | ||
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 | ||
|
||
$CXX_SENSE_VOICE_EXE | ||
rm -rf sherpa-onnx-sense-voice-* |
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
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
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
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
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
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,50 @@ | ||
#!/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]}) $*" | ||
} | ||
|
||
export GIT_CLONE_PROTECTION_ACTIVE=false | ||
|
||
echo "EXE is $EXE" | ||
echo "PATH: $PATH" | ||
|
||
which $EXE | ||
|
||
names=( | ||
tiny | ||
base | ||
) | ||
|
||
for name in ${names[@]}; do | ||
log "------------------------------------------------------------" | ||
log "Run $name" | ||
log "------------------------------------------------------------" | ||
|
||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-whisper-$name.tar.bz2 | ||
repo_url=https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-moonshine-$name-en-int8.tar.bz2 | ||
curl -SL -O $repo_url | ||
tar xvf sherpa-onnx-moonshine-$name-en-int8.tar.bz2 | ||
rm sherpa-onnx-moonshine-$name-en-int8.tar.bz2 | ||
repo=sherpa-onnx-moonshine-$name-en-int8 | ||
log "Start testing ${repo_url}" | ||
|
||
log "test int8 onnx" | ||
|
||
time $EXE \ | ||
--moonshine-preprocessor=$repo/preprocess.onnx \ | ||
--moonshine-encoder=$repo/encode.int8.onnx \ | ||
--moonshine-uncached-decoder=$repo/uncached_decode.int8.onnx \ | ||
--moonshine-cached-decoder=$repo/cached_decode.int8.onnx \ | ||
--tokens=$repo/tokens.txt \ | ||
--num-threads=2 \ | ||
$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
Oops, something went wrong.