Spaces:
Sleeping
Sleeping
global -> overall
Browse files- user-friendly-metrics.py +9 -9
user-friendly-metrics.py
CHANGED
@@ -113,13 +113,13 @@ class UserFriendlyMetrics(evaluate.Metric):
|
|
113 |
debug: bool = False,
|
114 |
):
|
115 |
"""
|
116 |
-
Logs metrics to Weights and Biases (wandb) for tracking and visualization, including categorized bar charts for
|
117 |
|
118 |
Args:
|
119 |
-
results (dict): Results dictionary with '
|
120 |
wandb_section (str, optional): W&B section for metric grouping. Defaults to None.
|
121 |
wandb_project (str, optional): The name of the wandb project. Defaults to 'user_friendly_metrics'.
|
122 |
-
log_plots (bool, optional): Generates categorized bar charts for
|
123 |
debug (bool, optional): Logs detailed summaries and histories to the terminal console. Defaults to False.
|
124 |
"""
|
125 |
|
@@ -160,14 +160,14 @@ class UserFriendlyMetrics(evaluate.Metric):
|
|
160 |
|
161 |
chart_data = {key: [] for key in categories.keys()}
|
162 |
|
163 |
-
# Log
|
164 |
-
if "
|
165 |
-
for
|
166 |
-
for metric, value in
|
167 |
log_key = (
|
168 |
-
f"{wandb_section}/
|
169 |
if wandb_section
|
170 |
-
else f"
|
171 |
)
|
172 |
run.log({log_key: value})
|
173 |
|
|
|
113 |
debug: bool = False,
|
114 |
):
|
115 |
"""
|
116 |
+
Logs metrics to Weights and Biases (wandb) for tracking and visualization, including categorized bar charts for overall metrics.
|
117 |
|
118 |
Args:
|
119 |
+
results (dict): Results dictionary with 'overall' and 'per_sequence' keys.
|
120 |
wandb_section (str, optional): W&B section for metric grouping. Defaults to None.
|
121 |
wandb_project (str, optional): The name of the wandb project. Defaults to 'user_friendly_metrics'.
|
122 |
+
log_plots (bool, optional): Generates categorized bar charts for overall metrics. Defaults to True.
|
123 |
debug (bool, optional): Logs detailed summaries and histories to the terminal console. Defaults to False.
|
124 |
"""
|
125 |
|
|
|
160 |
|
161 |
chart_data = {key: [] for key in categories.keys()}
|
162 |
|
163 |
+
# Log overall metrics
|
164 |
+
if "overall" in results:
|
165 |
+
for overall_key, overall_metrics in results["overall"].items():
|
166 |
+
for metric, value in overall_metrics["all"].items():
|
167 |
log_key = (
|
168 |
+
f"{wandb_section}/overall/{overall_key}/{metric}"
|
169 |
if wandb_section
|
170 |
+
else f"overall/{overall_key}/{metric}"
|
171 |
)
|
172 |
run.log({log_key: value})
|
173 |
|