-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchmarker.py
More file actions
88 lines (79 loc) · 2.54 KB
/
benchmarker.py
File metadata and controls
88 lines (79 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import argparse
import yaml
from asr_benchmark.benchmark import launch_benchmark
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Benchmarking tool for STT models")
parser.add_argument(
"config", type=str, default="config.yaml", help="Config file for the benchmark"
)
parser.add_argument(
"--input_manifest", type=str, default=None, help="Input manifest to be processed"
)
parser.add_argument(
"--output_folder", type=str, default=None, help="Output folder to be written"
)
parser.add_argument(
"--debug",
action="store_true",
default=False,
help="Debug mode, transcribing only 2 files per benchmarks",
)
parser.add_argument(
"--not_compute_rtf",
action="store_true",
default=None,
help="Do not compute RTF",
)
parser.add_argument(
"--not_save_alignments",
action="store_true",
default=None,
help="",
)
parser.add_argument(
"--not_save_predictions",
action="store_true",
default=None,
help="",
)
args = parser.parse_args()
config = yaml.load(open(args.config, "r"), Loader=yaml.FullLoader)
input_manifest = (
args.input_manifest
if args.input_manifest is not None
else config.pop("input_manifest", None)
)
output_folder = (
args.output_folder
if args.output_folder is not None
else config.pop("output_folder")
)
compute_rtf = (
not args.not_compute_rtf
if args.not_compute_rtf is not None
else config.pop("compute_rtf", True)
)
save_alignments = (
not args.not_save_alignments
if args.not_save_alignments is not None
else config.pop("save_alignments", True)
)
save_predictions = (
not args.not_save_predictions
if args.not_save_predictions is not None
else config.pop("save_predictions", True)
)
compute_latency = config.pop("compute_latency", False)
input_audios_paths = config.pop("input_audios_paths", "")
launch_benchmark(
config,
input_manifest,
output_folder,
compute_rtf,
args.debug,
skip_errors=config.pop("skip_errors", False),
save_alignments=save_alignments,
save_predictions=save_predictions,
compute_latency=compute_latency,
input_audios_paths=input_audios_paths
)