-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[TTS] Update multi-language eval report format #15915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -216,7 +216,9 @@ def run_inference_and_evaluation( | |||||||||||||||
| violin_plot_metrics.remove('utmosv2') | ||||||||||||||||
|
|
||||||||||||||||
| # Build full checkpoint identifier (include MoE info if present) | ||||||||||||||||
| full_checkpoint_name = f"{checkpoint_name}_{moe_info}{inference_config.build_identifier()}_SV_{eval_config.sv_model}_{eval_config.language}" | ||||||||||||||||
| full_checkpoint_name = ( | ||||||||||||||||
| f"{checkpoint_name}_{moe_info}{inference_config.build_identifier()}_SV_{eval_config.sv_model}" | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| # Tracking metrics across datasets | ||||||||||||||||
| ssim_per_dataset = [] | ||||||||||||||||
|
|
@@ -261,7 +263,7 @@ def run_inference_and_evaluation( | |||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| # Setup output directories | ||||||||||||||||
| eval_dir = os.path.join(out_dir, f"{full_checkpoint_name}_{dataset}") | ||||||||||||||||
| eval_dir = os.path.join(out_dir, f"{full_checkpoint_name}_{language}_{dataset}") | ||||||||||||||||
| audio_dir = os.path.join(eval_dir, "audio") | ||||||||||||||||
| os.makedirs(eval_dir, exist_ok=True) | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -336,12 +338,14 @@ def run_inference_and_evaluation( | |||||||||||||||
| filewise_metrics_all_repeats.extend(filewise_metrics) | ||||||||||||||||
|
|
||||||||||||||||
| # Save metrics | ||||||||||||||||
| with open(os.path.join(eval_dir, f"{dataset}_metrics_{repeat_idx}.json"), "w") as f: | ||||||||||||||||
| metrics_path = os.path.join(eval_dir, f"{dataset}_metrics_{repeat_idx}.json") | ||||||||||||||||
| with open(metrics_path, "w") as f: | ||||||||||||||||
| json.dump(metrics, f, indent=4) | ||||||||||||||||
|
|
||||||||||||||||
| sorted_filewise = sorted(filewise_metrics, key=lambda x: x.get('cer', 0), reverse=True) | ||||||||||||||||
| with open(os.path.join(eval_dir, f"{dataset}_filewise_metrics_{repeat_idx}.json"), "w") as f: | ||||||||||||||||
| json.dump(sorted_filewise, f, indent=4) | ||||||||||||||||
| filewise_metrics_path = os.path.join(eval_dir, f"{dataset}_filewise_metrics_{repeat_idx}.json") | ||||||||||||||||
| with open(filewise_metrics_path, "w", encoding="utf-8") as f: | ||||||||||||||||
| json.dump(sorted_filewise, f, indent=4, ensure_ascii=False) | ||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Open the JSON file with an explicit UTF-8 encoding.
Proposed fix- with open(os.path.join(eval_dir, f"{dataset}_filewise_metrics_{repeat_idx}.json"), "w") as f:
+ with open(
+ os.path.join(eval_dir, f"{dataset}_filewise_metrics_{repeat_idx}.json"),
+ "w",
+ encoding="utf-8",
+ ) as f:
json.dump(sorted_filewise, f, indent=4, ensure_ascii=False)📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| # Append to per-run CSV | ||||||||||||||||
| append_metrics_to_csv(per_run_csv, full_checkpoint_name, dataset, metrics) | ||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| from datetime import UTC, datetime, timedelta | ||
| from pathlib import Path | ||
|
|
||
| from scripts.tts_comparison_report.reporting.constants import DUMMY_TASK_ID, JIRA_TICKET_URL_PREFIX | ||
| from scripts.tts_comparison_report.reporting.constants import TICKET_URL_PREFIX | ||
| from scripts.tts_comparison_report.reporting.models import ExpirationInfo, TaskInfo | ||
|
|
||
|
|
||
|
|
@@ -37,21 +37,19 @@ def make_expiration_info(expires_in: int) -> ExpirationInfo: | |
|
|
||
|
|
||
| def make_task_info(task_id: str) -> TaskInfo: | ||
| """Create task metadata and the corresponding Jira link information. | ||
| """Create task metadata and the corresponding link information. | ||
|
|
||
| Args: | ||
| task_id: Jira task identifier used for the report. | ||
| task_id: Task identifier used for the report. | ||
|
|
||
| Returns: | ||
| Task information with the original task ID, derived Jira ID, and Jira URL. | ||
| Task information with the original task ID and task URL. | ||
| """ | ||
| jira_id = task_id if task_id != DUMMY_TASK_ID else task_id.split("-")[0] | ||
| jira_url = f"{JIRA_TICKET_URL_PREFIX}/{jira_id}" | ||
| task_url = f"{TICKET_URL_PREFIX}/{task_id}" | ||
|
|
||
| return TaskInfo( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous workflow was:
Currently,
As a result, when If we want to keep
Sorry for the earlier misunderstanding. |
||
| task_id=task_id, | ||
| jira_id=jira_id, | ||
| jira_url=jira_url, | ||
| task_url=task_url, | ||
| ) | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Preserve language in aggregate CSV identity.
full_checkpoint_nameno longer contains the dataset language, butappend_metrics_to_csvstill writes it at Lines 349 and 376 while the CSV schema has no language column. Multilingual runs can therefore produce indistinguishable aggregate rows for the same checkpoint and dataset. Add a language column or pass a language-qualified checkpoint identifier to the aggregate CSV writer.🤖 Prompt for AI Agents