Skip to content

Commit

Permalink
doc_str fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZr committed Jan 16, 2024
1 parent d90a24b commit c6669de
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 43 deletions.
35 changes: 20 additions & 15 deletions egs/aishell/ASR/zipformer/decode_bbpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,54 +21,59 @@
"""
Usage:
(1) greedy search
./zipformer_bbpe/decode.py \
./zipformer/decode_bbpe.py \
--epoch 35 \
--avg 15 \
--exp-dir ./zipformer_bbpe/exp \
--lang-dir data/lang_char \
--exp-dir ./zipformer/exp_bbpe \
--lang-dir data/lang_bbpe_500 \
--bpe-model data/lang_bbpe_500/bbpe.model \
--max-duration 600 \
--decoding-method greedy_search
(2) modified beam search
./zipformer_bbpe/decode.py \
./zipformer/decode_bbpe.py \
--epoch 35 \
--avg 15 \
--exp-dir ./zipformer_bbpe/exp \
--lang-dir data/lang_char \
--exp-dir ./zipformer/exp_bbpe \
--lang-dir data/lang_bbpe_500 \
--bpe-model data/lang_bbpe_500/bbpe.model \
--max-duration 600 \
--decoding-method modified_beam_search \
--beam-size 4
(3) fast beam search (trivial_graph)
./zipformer_bbpe/decode.py \
./zipformer/decode_bbpe.py \
--epoch 35 \
--avg 15 \
--exp-dir ./zipformer_bbpe/exp \
--lang-dir data/lang_char \
--exp-dir ./zipformer/exp_bbpe \
--lang-dir data/lang_bbpe_500 \
--bpe-model data/lang_bbpe_500/bbpe.model \
--max-duration 600 \
--decoding-method fast_beam_search \
--beam 20.0 \
--max-contexts 8 \
--max-states 64
(4) fast beam search (LG)
./zipformer_bbpe/decode.py \
./zipformer/decode_bbpe.py \
--epoch 30 \
--avg 15 \
--exp-dir ./zipformer_bbpe/exp \
--lang-dir data/lang_char \
--exp-dir ./zipformer/exp_bbpe \
--lang-dir data/lang_bbpe_500 \
--bpe-model data/lang_bbpe_500/bbpe.model \
--max-duration 600 \
--decoding-method fast_beam_search_LG \
--beam 20.0 \
--max-contexts 8 \
--max-states 64
(5) fast beam search (nbest oracle WER)
./zipformer_bbpe/decode.py \
./zipformer/decode_bbpe.py \
--epoch 35 \
--avg 15 \
--exp-dir ./zipformer_bbpe/exp \
--lang-dir data/lang_char \
--exp-dir ./zipformer/exp_bbpe \
--lang-dir data/lang_bbpe_500 \
--bpe-model data/lang_bbpe_500/bbpe.model \
--max-duration 600 \
--decoding-method fast_beam_search_nbest_oracle \
--beam 20.0 \
Expand Down
40 changes: 20 additions & 20 deletions egs/aishell/ASR/zipformer/pretrained_bbpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@
- For non-streaming model:
./zipformer_bbpe/export.py \
--exp-dir ./zipformer_bbpe/exp \
--bpe ./data/lang_bbpe_500/bbpe.model \
./zipformer/export.py \
--exp-dir ./zipformer/exp_bbpe \
--tokens ./data/lang_bbpe_500/tokens.txt \
--epoch 30 \
--avg 9
- For streaming model:
./zipformer_bbpe/export.py \
--exp-dir ./zipformer_bbpe/exp \
./zipformer/export.py \
--exp-dir ./zipformer/exp_bbpe \
--causal 1 \
--bpe ./data/lang_bbpe_500/bbpe.model \
--tokens ./data/lang_bbpe_500/tokens.txt \
--epoch 30 \
--avg 9
Expand All @@ -45,24 +45,24 @@
- For non-streaming model:
(1) greedy search
./zipformer_bbpe/pretrained.py \
--checkpoint ./zipformer_bbpe/exp/pretrained.pt \
./zipformer/pretrained_bbpe.py \
--checkpoint ./zipformer/exp_bbpe/pretrained.pt \
--bpe ./data/lang_bbpe_500/bbpe.model \
--method greedy_search \
/path/to/foo.wav \
/path/to/bar.wav
(2) modified beam search
./zipformer_bbpe/pretrained.py \
--checkpoint ./zipformer_bbpe/exp/pretrained.pt \
./zipformer/pretrained_bbpe.py \
--checkpoint ./zipformer/exp_bbpe/pretrained.pt \
--bpe ./data/lang_bbpe_500/bbpe.model \
--method modified_beam_search \
/path/to/foo.wav \
/path/to/bar.wav
(3) fast beam search
./zipformer_bbpe/pretrained.py \
--checkpoint ./zipformer_bbpe/exp/pretrained.pt \
./zipformer/pretrained_bbpe.py \
--checkpoint ./zipformer/exp_bbpe/pretrained.pt \
--bpe ./data/lang_bbpe_500/bbpe.model \
--method fast_beam_search \
/path/to/foo.wav \
Expand All @@ -71,8 +71,8 @@
- For streaming model:
(1) greedy search
./zipformer_bbpe/pretrained.py \
--checkpoint ./zipformer_bbpe/exp/pretrained.pt \
./zipformer/pretrained_bbpe.py \
--checkpoint ./zipformer/exp_bbpe/pretrained.pt \
--causal 1 \
--chunk-size 16 \
--left-context-frames 128 \
Expand All @@ -82,8 +82,8 @@
/path/to/bar.wav
(2) modified beam search
./zipformer_bbpe/pretrained.py \
--checkpoint ./zipformer_bbpe/exp/pretrained.pt \
./zipformer/pretrained_bbpe.py \
--checkpoint ./zipformer/exp_bbpe/pretrained.pt \
--causal 1 \
--chunk-size 16 \
--left-context-frames 128 \
Expand All @@ -93,8 +93,8 @@
/path/to/bar.wav
(3) fast beam search
./zipformer_bbpe/pretrained.py \
--checkpoint ./zipformer_bbpe/exp/pretrained.pt \
./zipformer/pretrained_bbpe.py \
--checkpoint ./zipformer/exp_bbpe/pretrained.pt \
--causal 1 \
--chunk-size 16 \
--left-context-frames 128 \
Expand All @@ -104,9 +104,9 @@
/path/to/bar.wav
You can also use `./zipformer_bbpe/exp/epoch-xx.pt`.
You can also use `./zipformer/exp_bbpe/epoch-xx.pt`.
Note: ./zipformer_bbpe/exp/pretrained.pt is generated by ./zipformer_bbpe/export.py
Note: ./zipformer/exp_bbpe/pretrained.pt is generated by ./zipformer/export_bbpe.py
"""


Expand Down
12 changes: 4 additions & 8 deletions egs/aishell/ASR/zipformer/train_bbpe.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,21 @@
export CUDA_VISIBLE_DEVICES="0,1,2,3,4,5,6,7"
./zipformer/train.py \
./zipformer/train_bbpe.py \
--world-size 8 \
--num-epochs 12 \
--start-epoch 1 \
--exp-dir zipformer/exp \
--training-subset L
--lr-epochs 1.5 \
--exp-dir zipformer/exp_bbpe \
--max-duration 350
# For mix precision training:
./zipformer/train.py \
./zipformer/train_bbpe.py \
--world-size 8 \
--num-epochs 12 \
--start-epoch 1 \
--use-fp16 1 \
--exp-dir zipformer/exp \
--training-subset L \
--lr-epochs 1.5 \
--exp-dir zipformer/exp_bbpe \
--max-duration 750
"""
Expand Down

0 comments on commit c6669de

Please sign in to comment.