mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
from local
This commit is contained in:
parent
4527fabfe2
commit
a568e37484
Binary file not shown.
@ -628,14 +628,15 @@ def save_results(
|
|||||||
for key, val in test_set_wers:
|
for key, val in test_set_wers:
|
||||||
print("{}\t{}".format(key, val), file=f)
|
print("{}\t{}".format(key, val), file=f)
|
||||||
|
|
||||||
|
wer = None
|
||||||
s = "\nFor {}, WER of different settings are:\n".format(test_set_name)
|
s = "\nFor {}, WER of different settings are:\n".format(test_set_name)
|
||||||
note = "\tbest for {}".format(test_set_name)
|
note = "\tbest for {}".format(test_set_name)
|
||||||
for key, val in test_set_wers:
|
for key, val in test_set_wers:
|
||||||
s += "{}\t{}{}\n".format(key, val, note)
|
s += "{}\t{}{}\n".format(key, val, note)
|
||||||
note = ""
|
note = ""
|
||||||
print(key)
|
wer = val
|
||||||
print(val)
|
|
||||||
logging.info(s)
|
logging.info(s)
|
||||||
|
return val
|
||||||
|
|
||||||
|
|
||||||
@torch.no_grad()
|
@torch.no_grad()
|
||||||
@ -816,7 +817,12 @@ def main() -> None:
|
|||||||
eos_id=eos_id,
|
eos_id=eos_id,
|
||||||
)
|
)
|
||||||
|
|
||||||
save_results(params=params, test_set_name=test_set, results_dict=results_dict)
|
wer = save_results(params=params, test_set_name=test_set, results_dict=results_dict)
|
||||||
|
wer_dict[epoch] = wer
|
||||||
|
|
||||||
|
wer_dict = sorted(wer_dict.items(), key=lambda x:x[1])
|
||||||
|
for k, v in wer_dict:
|
||||||
|
print(k, v)
|
||||||
|
|
||||||
torch.set_num_threads(1)
|
torch.set_num_threads(1)
|
||||||
# when we import add_model_arguments from train.py
|
# when we import add_model_arguments from train.py
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user