mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-26 10:16:14 +00:00
fix the style issue
This commit is contained in:
parent
33b88eee2b
commit
c8afe05e73
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user