diff --git a/egs/librispeech/ASR/pruned_transducer_stateless/streaming_decode.py b/egs/librispeech/ASR/pruned_transducer_stateless/streaming_decode.py index 6867dedb8..884a42ea4 100755 --- a/egs/librispeech/ASR/pruned_transducer_stateless/streaming_decode.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless/streaming_decode.py @@ -285,7 +285,6 @@ def fast_beam_search( def decode_one_chunk( params: AttributeDict, model: nn.Module, - sp: spm.SentencePieceProcessor, decode_streams: List[DecodeStream], ) -> List[int]: """Decode one chunk frames of features for each decode_streams and @@ -296,8 +295,6 @@ def decode_one_chunk( It's the return value of :func:`get_params`. model: The neural model. - sp: - The BPE model. decode_streams: A List of DecodeStream, each belonging to a utterance. Returns: @@ -469,7 +466,7 @@ def decode_dataset( while len(decode_streams) >= params.num_decode_streams: finished_streams = decode_one_chunk( - params, model, sp, decode_streams + params=params, model=model, decode_streams=decode_streams ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp @@ -488,7 +485,9 @@ def decode_dataset( # decode final chunks of last sequences while len(decode_streams): - finished_streams = decode_one_chunk(params, model, sp, decode_streams) + finished_streams = decode_one_chunk( + params=params, model=model, decode_streams=decode_streams + ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp if params.decoding_method == "greedy_search": diff --git a/egs/librispeech/ASR/pruned_transducer_stateless2/streaming_decode.py b/egs/librispeech/ASR/pruned_transducer_stateless2/streaming_decode.py index 850a574ae..0ef0b3cda 100755 --- a/egs/librispeech/ASR/pruned_transducer_stateless2/streaming_decode.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless2/streaming_decode.py @@ -291,7 +291,6 @@ def fast_beam_search( def decode_one_chunk( params: AttributeDict, model: nn.Module, - sp: spm.SentencePieceProcessor, decode_streams: List[DecodeStream], ) -> List[int]: """Decode one chunk frames of features for each decode_streams and @@ -302,8 +301,6 @@ def decode_one_chunk( It's the return value of :func:`get_params`. model: The neural model. - sp: - The BPE model. decode_streams: A List of DecodeStream, each belonging to a utterance. Returns: @@ -477,7 +474,7 @@ def decode_dataset( while len(decode_streams) >= params.num_decode_streams: finished_streams = decode_one_chunk( - params, model, sp, decode_streams + params=params, model=model, decode_streams=decode_streams ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp @@ -496,7 +493,9 @@ def decode_dataset( # decode final chunks of last sequences while len(decode_streams): - finished_streams = decode_one_chunk(params, model, sp, decode_streams) + finished_streams = decode_one_chunk( + params=params, model=model, decode_streams=decode_streams + ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp if params.decoding_method == "greedy_search": diff --git a/egs/librispeech/ASR/pruned_transducer_stateless3/streaming_decode.py b/egs/librispeech/ASR/pruned_transducer_stateless3/streaming_decode.py index 490ca54da..e1255c983 100755 --- a/egs/librispeech/ASR/pruned_transducer_stateless3/streaming_decode.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless3/streaming_decode.py @@ -292,7 +292,6 @@ def fast_beam_search( def decode_one_chunk( params: AttributeDict, model: nn.Module, - sp: spm.SentencePieceProcessor, decode_streams: List[DecodeStream], ) -> List[int]: """Decode one chunk frames of features for each decode_streams and @@ -303,8 +302,6 @@ def decode_one_chunk( It's the return value of :func:`get_params`. model: The neural model. - sp: - The BPE model. decode_streams: A List of DecodeStream, each belonging to a utterance. Returns: @@ -478,7 +475,7 @@ def decode_dataset( while len(decode_streams) >= params.num_decode_streams: finished_streams = decode_one_chunk( - params, model, sp, decode_streams + params=params, model=model, decode_streams=decode_streams ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp @@ -497,7 +494,9 @@ def decode_dataset( # decode final chunks of last sequences while len(decode_streams): - finished_streams = decode_one_chunk(params, model, sp, decode_streams) + finished_streams = decode_one_chunk( + params=params, model=model, decode_streams=decode_streams + ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp if params.decoding_method == "greedy_search": diff --git a/egs/librispeech/ASR/pruned_transducer_stateless4/streaming_decode.py b/egs/librispeech/ASR/pruned_transducer_stateless4/streaming_decode.py index ed14fc056..2fcea2eb5 100755 --- a/egs/librispeech/ASR/pruned_transducer_stateless4/streaming_decode.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless4/streaming_decode.py @@ -304,7 +304,6 @@ def fast_beam_search( def decode_one_chunk( params: AttributeDict, model: nn.Module, - sp: spm.SentencePieceProcessor, decode_streams: List[DecodeStream], ) -> List[int]: """Decode one chunk frames of features for each decode_streams and @@ -315,8 +314,6 @@ def decode_one_chunk( It's the return value of :func:`get_params`. model: The neural model. - sp: - The BPE model. decode_streams: A List of DecodeStream, each belonging to a utterance. Returns: @@ -490,7 +487,7 @@ def decode_dataset( while len(decode_streams) >= params.num_decode_streams: finished_streams = decode_one_chunk( - params, model, sp, decode_streams + params=params, model=model, decode_streams=decode_streams ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp @@ -509,7 +506,9 @@ def decode_dataset( # decode final chunks of last sequences while len(decode_streams): - finished_streams = decode_one_chunk(params, model, sp, decode_streams) + finished_streams = decode_one_chunk( + params=params, model=model, decode_streams=decode_streams + ) for i in sorted(finished_streams, reverse=True): hyp = decode_streams[i].hyp if params.decoding_method == "greedy_search":