Fix type hints for decode.py (#638)

* Fix type hints for decode.py

* Fix flake8
This commit is contained in:
Wei Kang 2022-10-30 16:35:30 +08:00 committed by GitHub
parent 6709bf1e63
commit 581d0361cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View File

@ -511,7 +511,7 @@ def decode_dataset(
sp: spm.SentencePieceProcessor,
word_table: Optional[k2.SymbolTable] = None,
decoding_graph: Optional[k2.Fsa] = None,
) -> Dict[str, List[str, Tuple[str, List[str], List[str]]]]:
) -> Dict[str, List[Tuple[str, List[str], List[str]]]]:
"""Decode dataset.
Args:
@ -585,7 +585,7 @@ def decode_dataset(
def save_results(
params: AttributeDict,
test_set_name: str,
results_dict: Dict[str, List[str, Tuple[str, List[str], List[str]]]],
results_dict: Dict[str, List[Tuple[str, List[str], List[str]]]],
):
test_set_wers = dict()
for key, results in results_dict.items():

View File

@ -327,9 +327,8 @@ def get_parser():
default=0.5,
help="The probability to select a batch from the GigaSpeech dataset",
)
add_model_arguments(parser)
return parser

View File

@ -612,7 +612,7 @@ def decode_dataset(
def save_results(
params: AttributeDict,
test_set_name: str,
results_dict: Dict[str, List[str, Tuple[List[str], List[str]]]],
results_dict: Dict[str, List[Tuple[str, List[str], List[str]]]],
):
test_set_wers = dict()
for key, results in results_dict.items():

View File

@ -327,7 +327,7 @@ def decode_dataset(
def save_results(
params: AttributeDict,
test_set_name: str,
results_dict: Dict[str, List[str, Tuple[List[str], List[str]]]],
results_dict: Dict[str, List[Tuple[str, List[str], List[str]]]],
):
test_set_wers = dict()
for key, results in results_dict.items():