minor updates

This commit is contained in:
jinzr 2023-11-22 17:41:00 +08:00
parent 5074520b88
commit adce588c49
3 changed files with 17 additions and 20 deletions

View File

@ -19,23 +19,20 @@
import argparse
import inspect
import logging
from functools import lru_cache
from pathlib import Path
from typing import Any, Dict, Optional
import torch
from lhotse import CutSet, Fbank, FbankConfig, load_manifest, load_manifest_lazy
from lhotse import CutSet, Fbank, FbankConfig, load_manifest
from lhotse.dataset import ( # noqa F401 for PrecomputedFeatures
CutConcatenate,
CutMix,
DynamicBucketingSampler,
K2SpeechRecognitionDataset,
PrecomputedFeatures,
SimpleCutSampler,
SpecAugment,
)
from lhotse.dataset.input_strategies import ( # noqa F401 For AudioSamples
AudioSamples,
OnTheFlyFeatures,
)
from lhotse.utils import fix_random_seed

View File

@ -33,7 +33,7 @@ dataset, you should change the argument values according to your dataset.
./zipformer/export.py \
--exp-dir ./zipformer/exp \
--tokens data/lang_bpe_2000/tokens.txt \
--tokens data/lang_bbpe_2000/tokens.txt \
--epoch 20 \
--avg 1 \
--jit 1
@ -53,7 +53,7 @@ for how to use the exported models outside of icefall.
--causal 1 \
--chunk-size 16 \
--left-context-frames 128 \
--tokens data/lang_bpe_2000/tokens.txt \
--tokens data/lang_bbpe_2000/tokens.txt \
--epoch 20 \
--avg 1 \
--jit 1
@ -72,7 +72,7 @@ for how to use the exported models outside of icefall.
./zipformer/export.py \
--exp-dir ./zipformer/exp \
--tokens data/lang_bpe_2000/tokens.txt \
--tokens data/lang_bbpe_2000/tokens.txt \
--epoch 20 \
--avg 1
@ -81,7 +81,7 @@ for how to use the exported models outside of icefall.
./zipformer/export.py \
--exp-dir ./zipformer/exp \
--causal 1 \
--tokens data/lang_bpe_2000/tokens.txt \
--tokens data/lang_bbpe_2000/tokens.txt \
--epoch 20 \
--avg 1
@ -103,7 +103,7 @@ you can do:
--avg 1 \
--max-duration 600 \
--decoding-method greedy_search \
--bpe-model data/lang_bpe_2000/bpe.model
--bpe-model data/lang_bbpe_2000/bpe.model
- For streaming model:
@ -124,7 +124,7 @@ To use the generated file with `zipformer/decode.py` and `zipformer/streaming_de
--chunk-size 16 \
--left-context-frames 128 \
--decoding-method greedy_search \
--bpe-model data/lang_bpe_2000/bpe.model
--bpe-model data/lang_bbpe_2000/bpe.model
# chunk-wise streaming decoding
./zipformer/streaming_decode.py \
@ -136,7 +136,7 @@ To use the generated file with `zipformer/decode.py` and `zipformer/streaming_de
--chunk-size 16 \
--left-context-frames 128 \
--decoding-method greedy_search \
--bpe-model data/lang_bpe_2000/bpe.model
--bpe-model data/lang_bbpe_2000/bpe.model
Check ./pretrained.py for its usage.
@ -251,7 +251,7 @@ def get_parser():
parser.add_argument(
"--tokens",
type=str,
default="data/lang_bpe_2000/tokens.txt",
default="data/lang_bbpe_2000/tokens.txt",
help="Path to the tokens.txt",
)

View File

@ -25,7 +25,7 @@ dataset, you should change the argument values according to your dataset.
./zipformer/export.py \
--exp-dir ./zipformer/exp \
--tokens data/lang_bpe_2000/tokens.txt \
--tokens data/lang_bbpe_2000/tokens.txt \
--epoch 23 \
--avg 1
@ -34,7 +34,7 @@ dataset, you should change the argument values according to your dataset.
./zipformer/export.py \
--exp-dir ./zipformer/exp \
--causal 1 \
--tokens data/lang_bpe_2000/tokens.txt \
--tokens data/lang_bbpe_2000/tokens.txt \
--epoch 23 \
--avg 1
@ -45,7 +45,7 @@ Usage of this script:
(1) greedy search
./zipformer/pretrained.py \
--checkpoint ./zipformer/exp/pretrained.pt \
--tokens data/lang_bpe_2000/tokens.txt \
--tokens data/lang_bbpe_2000/tokens.txt \
--method greedy_search \
/path/to/foo.wav \
/path/to/bar.wav
@ -53,7 +53,7 @@ Usage of this script:
(2) modified beam search
./zipformer/pretrained.py \
--checkpoint ./zipformer/exp/pretrained.pt \
--tokens ./data/lang_bpe_2000/tokens.txt \
--tokens ./data/lang_bbpe_2000/tokens.txt \
--method modified_beam_search \
/path/to/foo.wav \
/path/to/bar.wav
@ -61,7 +61,7 @@ Usage of this script:
(3) fast beam search
./zipformer/pretrained.py \
--checkpoint ./zipformer/exp/pretrained.pt \
--tokens ./data/lang_bpe_2000/tokens.txt \
--tokens ./data/lang_bbpe_2000/tokens.txt \
--method fast_beam_search \
/path/to/foo.wav \
/path/to/bar.wav
@ -74,7 +74,7 @@ Usage of this script:
--causal 1 \
--chunk-size 16 \
--left-context-frames 128 \
--tokens ./data/lang_bpe_2000/tokens.txt \
--tokens ./data/lang_bbpe_2000/tokens.txt \
--method greedy_search \
/path/to/foo.wav \
/path/to/bar.wav
@ -85,7 +85,7 @@ Usage of this script:
--causal 1 \
--chunk-size 16 \
--left-context-frames 128 \
--tokens ./data/lang_bpe_2000/tokens.txt \
--tokens ./data/lang_bbpe_2000/tokens.txt \
--method modified_beam_search \
/path/to/foo.wav \
/path/to/bar.wav
@ -96,7 +96,7 @@ Usage of this script:
--causal 1 \
--chunk-size 16 \
--left-context-frames 128 \
--tokens ./data/lang_bpe_2000/tokens.txt \
--tokens ./data/lang_bbpe_2000/tokens.txt \
--method fast_beam_search \
/path/to/foo.wav \
/path/to/bar.wav