Skip to content

Commit

Permalink
Add streaming HLG decoding for zipformer CTC.
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Mar 18, 2024
1 parent eec12f0 commit 40668e4
Show file tree
Hide file tree
Showing 3 changed files with 443 additions and 6 deletions.
4 changes: 2 additions & 2 deletions egs/librispeech/ASR/zipformer/export-onnx-streaming-ctc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
--joiner-dim 512 \
--causal True \
--chunk-size 16 \
--left-context-frames 64 \
--left-context-frames 128 \
--use-ctc 1
The --chunk-size in training is "16,32,64,-1", so we select one of them
Expand All @@ -41,7 +41,7 @@
It will generate the following file inside $repo/exp:
- ctc-epoch-99-avg-1-chunk-16-left-64.onnx
- ctc-epoch-99-avg-1-chunk-16-left-128.onnx
See ./onnx_pretrained-streaming-ctc.py for how to use the exported ONNX models.
"""
Expand Down
8 changes: 4 additions & 4 deletions egs/librispeech/ASR/zipformer/export-onnx-streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@
--joiner-dim 512 \
--causal True \
--chunk-size 16 \
--left-context-frames 64
--left-context-frames 128
The --chunk-size in training is "16,32,64,-1", so we select one of them
(excluding -1) during streaming export. The same applies to `--left-context`,
whose value is "64,128,256,-1".
It will generate the following 3 files inside $repo/exp:
- encoder-epoch-99-avg-1-chunk-16-left-64.onnx
- decoder-epoch-99-avg-1-chunk-16-left-64.onnx
- joiner-epoch-99-avg-1-chunk-16-left-64.onnx
- encoder-epoch-99-avg-1-chunk-16-left-128.onnx
- decoder-epoch-99-avg-1-chunk-16-left-128.onnx
- joiner-epoch-99-avg-1-chunk-16-left-128.onnx
See ./onnx_pretrained-streaming.py for how to use the exported ONNX models.
"""
Expand Down
Loading

0 comments on commit 40668e4

Please sign in to comment.