[Bugfix] Update the value of --max-seed-tts-mean-wer in the accuracy test. (#4160)
Signed-off-by: amy-why-3459 <wuhaiyan17@huawei.com>
This commit is contained in:
1 parent
3875b81c18
commit
1e43656ab1
2 files changed
+19
-2
No files matched your search
@@ -340,7 +340,7 @@ def build_arg_parser() -> argparse.ArgumentParser:
|
||||
p.add_argument(
|
||||
"--max-seed-tts-mean-wer",
|
||||
type=float,
|
||||
default=0.25,
|
||||
default=0.35,
|
||||
help="If set, fail when seed_tts_content_error_mean is strictly above this value.",
|
||||
)
|
||||
p.add_argument(
|
||||
|
||||
@@ -94,7 +94,13 @@ def _format_table(
|
||||
if isinstance(value, float):
|
||||
return f"{value:,.3f}"
|
||||
if isinstance(value, list):
|
||||
return ", ".join(str(f"{v:,.3f}") for v in value)
|
||||
if not value:
|
||||
return ""
|
||||
try:
|
||||
avg = sum(float(v) for v in value) / len(value)
|
||||
return f"{avg:,.3f} (n={len(value)})"
|
||||
except (TypeError, ValueError):
|
||||
return ", ".join(str(v) for v in value)
|
||||
return str(value)
|
||||
|
||||
table = PrettyTable()
|
||||
@@ -117,6 +123,17 @@ def _format_table(
|
||||
if column_key is None:
|
||||
raise ValueError("column_key is required for multi-column mode")
|
||||
col_headers = [f"{column_prefix}{row.get(column_key, '?')}" for row in data]
|
||||
# PrettyTable requires unique field names. When the same column key
|
||||
# appears more than once (e.g. two events with the same stage_id),
|
||||
# deduplicate by appending _2, _3, … to the later occurrences.
|
||||
if len(col_headers) != len(set(col_headers)):
|
||||
seen: dict[str, int] = {}
|
||||
deduped: list[str] = []
|
||||
for h in col_headers:
|
||||
n = seen.get(h, 0)
|
||||
seen[h] = n + 1
|
||||
deduped.append(h if n == 0 else f"{h}_{n + 1}")
|
||||
col_headers = deduped
|
||||
table.field_names = ["Field"] + col_headers
|
||||
table.align["Field"] = "l"
|
||||
for col in col_headers:
|
||||
|
||||
Reference in new issue
Block a user