Fix LG log file name (#657)

This commit is contained in:
Wei Kang 2022-11-03 23:12:35 +08:00 committed by GitHub
parent 163d929601
commit 64aed2cdeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 20 deletions

View File

@ -504,8 +504,8 @@ def decode_one_batch(
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
key += f"_num_paths_{params.num_paths}_" key += f"_num_paths_{params.num_paths}_"
key += f"nbest_scale_{params.nbest_scale}" key += f"nbest_scale_{params.nbest_scale}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
key += f"_ngram_lm_scale_{params.ngram_lm_scale}" key += f"_ngram_lm_scale_{params.ngram_lm_scale}"
return {key: hyps} return {key: hyps}
else: else:
@ -675,8 +675,8 @@ def main():
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
params.suffix += f"-nbest-scale-{params.nbest_scale}" params.suffix += f"-nbest-scale-{params.nbest_scale}"
params.suffix += f"-num-paths-{params.num_paths}" params.suffix += f"-num-paths-{params.num_paths}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}" params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}"
elif "beam_search" in params.decoding_method: elif "beam_search" in params.decoding_method:
params.suffix += ( params.suffix += (
f"-{params.decoding_method}-beam-size-{params.beam_size}" f"-{params.decoding_method}-beam-size-{params.beam_size}"

View File

@ -527,8 +527,8 @@ def decode_one_batch(
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
key += f"_num_paths_{params.num_paths}_" key += f"_num_paths_{params.num_paths}_"
key += f"nbest_scale_{params.nbest_scale}" key += f"nbest_scale_{params.nbest_scale}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
key += f"_ngram_lm_scale_{params.ngram_lm_scale}" key += f"_ngram_lm_scale_{params.ngram_lm_scale}"
return {key: hyps} return {key: hyps}
else: else:
@ -697,8 +697,8 @@ def main():
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
params.suffix += f"-nbest-scale-{params.nbest_scale}" params.suffix += f"-nbest-scale-{params.nbest_scale}"
params.suffix += f"-num-paths-{params.num_paths}" params.suffix += f"-num-paths-{params.num_paths}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}" params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}"
elif "beam_search" in params.decoding_method: elif "beam_search" in params.decoding_method:
params.suffix += ( params.suffix += (
f"-{params.decoding_method}-beam-size-{params.beam_size}" f"-{params.decoding_method}-beam-size-{params.beam_size}"

View File

@ -686,8 +686,8 @@ def decode_one_batch(
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
key += f"_num_paths_{params.num_paths}_" key += f"_num_paths_{params.num_paths}_"
key += f"nbest_scale_{params.nbest_scale}" key += f"nbest_scale_{params.nbest_scale}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
key += f"_ngram_lm_scale_{params.ngram_lm_scale}" key += f"_ngram_lm_scale_{params.ngram_lm_scale}"
return {key: hyps} return {key: hyps}
else: else:
return { return {
@ -936,8 +936,8 @@ def main():
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
params.suffix += f"-nbest-scale-{params.nbest_scale}" params.suffix += f"-nbest-scale-{params.nbest_scale}"
params.suffix += f"-num-paths-{params.num_paths}" params.suffix += f"-num-paths-{params.num_paths}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}" params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}"
elif "beam_search" in params.decoding_method: elif "beam_search" in params.decoding_method:
params.suffix += ( params.suffix += (
f"-{params.decoding_method}-beam-size-{params.beam_size}" f"-{params.decoding_method}-beam-size-{params.beam_size}"

View File

@ -551,8 +551,8 @@ def decode_one_batch(
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
key += f"_num_paths_{params.num_paths}_" key += f"_num_paths_{params.num_paths}_"
key += f"nbest_scale_{params.nbest_scale}" key += f"nbest_scale_{params.nbest_scale}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
key += f"_ngram_lm_scale_{params.ngram_lm_scale}" key += f"_ngram_lm_scale_{params.ngram_lm_scale}"
return {key: (hyps, timestamps)} return {key: (hyps, timestamps)}
else: else:
@ -770,8 +770,8 @@ def main():
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
params.suffix += f"-nbest-scale-{params.nbest_scale}" params.suffix += f"-nbest-scale-{params.nbest_scale}"
params.suffix += f"-num-paths-{params.num_paths}" params.suffix += f"-num-paths-{params.num_paths}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}" params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}"
elif "beam_search" in params.decoding_method: elif "beam_search" in params.decoding_method:
params.suffix += ( params.suffix += (
f"-{params.decoding_method}-beam-size-{params.beam_size}" f"-{params.decoding_method}-beam-size-{params.beam_size}"

View File

@ -516,8 +516,8 @@ def decode_one_batch(
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
key += f"_num_paths_{params.num_paths}_" key += f"_num_paths_{params.num_paths}_"
key += f"nbest_scale_{params.nbest_scale}" key += f"nbest_scale_{params.nbest_scale}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
key += f"_ngram_lm_scale_{params.ngram_lm_scale}" key += f"_ngram_lm_scale_{params.ngram_lm_scale}"
return {key: hyps} return {key: hyps}
else: else:
@ -685,8 +685,8 @@ def main():
if "nbest" in params.decoding_method: if "nbest" in params.decoding_method:
params.suffix += f"-nbest-scale-{params.nbest_scale}" params.suffix += f"-nbest-scale-{params.nbest_scale}"
params.suffix += f"-num-paths-{params.num_paths}" params.suffix += f"-num-paths-{params.num_paths}"
if "LG" in params.decoding_method: if "LG" in params.decoding_method:
params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}" params.suffix += f"-ngram-lm-scale-{params.ngram_lm_scale}"
elif "beam_search" in params.decoding_method: elif "beam_search" in params.decoding_method:
params.suffix += ( params.suffix += (
f"-{params.decoding_method}-beam-size-{params.beam_size}" f"-{params.decoding_method}-beam-size-{params.beam_size}"