Add HLG decoding for streaming CTC models (#731)

This commit is contained in:
Fangjun Kuang
2024-04-03 21:31:42 +08:00
committed by GitHub
parent f8832cb5f2
commit db67e00c77
28 changed files with 668 additions and 82 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -e
set -ex
log() {
# This function is from espnet
@@ -13,6 +13,26 @@ echo "PATH: $PATH"
which $EXE
log "------------------------------------------------------------"
log "Run streaming Zipformer2 CTC HLG decoding "
log "------------------------------------------------------------"
curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18.tar.bz2
tar xvf sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18.tar.bz2
rm sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18.tar.bz2
repo=$PWD/sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18
ls -lh $repo
echo "pwd: $PWD"
$EXE \
--zipformer2-ctc-model=$repo/ctc-epoch-30-avg-3-chunk-16-left-128.int8.onnx \
--ctc-graph=$repo/HLG.fst \
--tokens=$repo/tokens.txt \
$repo/test_wavs/0.wav \
$repo/test_wavs/1.wav \
$repo/test_wavs/8k.wav
rm -rf sherpa-onnx-streaming-zipformer-ctc-small-2024-03-18
log "------------------------------------------------------------"
log "Run streaming Zipformer2 CTC "
log "------------------------------------------------------------"