remove unused arguments

This commit is contained in:
pkufool 2022-06-27 20:09:40 +08:00
parent 90bc61e970
commit 0a1080e7b8
4 changed files with 16 additions and 20 deletions

View File

@ -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":

View File

@ -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":

View File

@ -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":

View File

@ -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":