Update streaming_ctc_decode.py

This commit is contained in:
jinzr 2023-12-07 11:12:47 +08:00
parent 7fb3b13066
commit 206f2143e8

View File

@ -128,7 +128,7 @@ def get_parser():
parser.add_argument(
"--bpe-model",
type=str,
default="data/lang_bpe_2000/bpe.model",
default="data/lang_bpe_500/bpe.model",
help="Path to the BPE model",
)
@ -196,6 +196,22 @@ def get_parser():
return parser
def get_decoding_params() -> AttributeDict:
"""Parameters for decoding."""
params = AttributeDict(
{
"feature_dim": 80,
"frame_shift_ms": 10,
"search_beam": 20,
"output_beam": 8,
"min_active_states": 30,
"max_active_states": 10000,
"use_double_scores": True,
}
)
return params
def decode_one_chunk(
params: AttributeDict,
model: nn.Module,
@ -463,21 +479,6 @@ def save_results(
logging.info(s)
def get_decoding_params() -> AttributeDict:
"""Parameters for decoding."""
params = AttributeDict(
{
"frame_shift_ms": 10,
"search_beam": 20,
"output_beam": 8,
"min_active_states": 30,
"max_active_states": 10000,
"use_double_scores": True,
}
)
return params
@torch.no_grad()
def main():
parser = get_parser()