From c8afe05e737c326d0ff17b8e3c4f421ff036325f Mon Sep 17 00:00:00 2001 From: Mingshuang Luo <37799481+luomingshuang@users.noreply.github.com> Date: Wed, 13 Oct 2021 10:27:16 +0800 Subject: [PATCH] fix the style issue --- egs/librispeech/ASR/conformer_ctc/pretrained.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc/pretrained.py b/egs/librispeech/ASR/conformer_ctc/pretrained.py index 3ed2d74e5..07d3e7269 100755 --- a/egs/librispeech/ASR/conformer_ctc/pretrained.py +++ b/egs/librispeech/ASR/conformer_ctc/pretrained.py @@ -59,7 +59,7 @@ def get_parser(): type=str, required=True, help="Path to lang bpe dir.", - ) + ) parser.add_argument( "--method", @@ -325,7 +325,9 @@ def main(): "attention-decoder", ]: logging.info(f"Loading HLG from {params.lang_dir}/HLG.pt") - HLG = k2.Fsa.from_dict(torch.load(params.lang_dir + "/HLG.pt", map_location="cpu")) + HLG = k2.Fsa.from_dict( + torch.load(params.lang_dir + "/HLG.pt", map_location="cpu") + ) HLG = HLG.to(device) if not hasattr(HLG, "lm_scores"): # For whole-lattice-rescoring and attention-decoder @@ -390,7 +392,9 @@ def main(): best_path = next(iter(best_path_dict.values())) hyps = get_texts(best_path) - word_sym_table = k2.SymbolTable.from_file(params.lang_dir + "/words.txt") + word_sym_table = k2.SymbolTable.from_file( + params.lang_dir + "/words.txt" + ) hyps = [[word_sym_table[i] for i in ids] for ids in hyps] s = "\n"