Skip to content

Commit

Permalink
Update CI to test H/HL/HLG ctc decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Oct 7, 2023
1 parent 46a320e commit d21842b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/scripts/test-offline-ctc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,48 @@ time $EXE \
$repo/test_wavs/8k.wav

rm -rf $repo

log "------------------------------------------------------------"
log "Run Librispeech zipformer CTC H/HL/HLG decoding (English) "
log "------------------------------------------------------------"
repo_url=https://huggingface.co/csukuangfj/sherpa-onnx-zipformer-ctc-en-2023-10-02
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"
git lfs pull --include "*.fst"
ls -lh
popd

graphs=(
$repo/H.fst
$repo/HL.fst
$repo/HLG.fst
)

for graph in ${graphs[@]}; do
log "test float32 models with $graph"
time $EXE \
--model-type=zipformer2_ctc \
--ctc.graph=$graph \
--zipformer-ctc-model=$repo/model.onnx \
--tokens=$repo/tokens.txt \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/2.wav

log "test int8 models with $graph"
time $EXE \
--model-type=zipformer2_ctc \
--ctc.graph=$graph \
--zipformer-ctc-model=$repo/model.int8.onnx \
--tokens=$repo/tokens.txt \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/2.wav
done

rm -rf $repo

0 comments on commit d21842b

Please sign in to comment.