Spaces:
Sleeping
Sleeping
wandb_logs_fix (my bad)
Browse files- user-friendly-metrics.py +15 -1
user-friendly-metrics.py
CHANGED
|
@@ -111,6 +111,7 @@ class UserFriendlyMetrics(evaluate.Metric):
|
|
| 111 |
self,
|
| 112 |
results,
|
| 113 |
wandb_section: str = None,
|
|
|
|
| 114 |
wandb_project="user_friendly_metrics",
|
| 115 |
log_plots: bool = True,
|
| 116 |
debug: bool = False,
|
|
@@ -129,7 +130,20 @@ class UserFriendlyMetrics(evaluate.Metric):
|
|
| 129 |
current_datetime = datetime.datetime.now()
|
| 130 |
formatted_datetime = current_datetime.strftime("%Y-%m-%d_%H-%M-%S")
|
| 131 |
wandb.login(key=os.getenv("WANDB_API_KEY"))
|
| 132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
run = wandb.init(
|
| 134 |
project=wandb_project,
|
| 135 |
name=f"evaluation-{formatted_datetime}",
|
|
|
|
| 111 |
self,
|
| 112 |
results,
|
| 113 |
wandb_section: str = None,
|
| 114 |
+
wandb_runs = None
|
| 115 |
wandb_project="user_friendly_metrics",
|
| 116 |
log_plots: bool = True,
|
| 117 |
debug: bool = False,
|
|
|
|
| 130 |
current_datetime = datetime.datetime.now()
|
| 131 |
formatted_datetime = current_datetime.strftime("%Y-%m-%d_%H-%M-%S")
|
| 132 |
wandb.login(key=os.getenv("WANDB_API_KEY"))
|
| 133 |
+
|
| 134 |
+
if not wandb_runs is None:
|
| 135 |
+
assert len(wandb_runs) == len(results), "runs and results must have the same length"
|
| 136 |
+
else:
|
| 137 |
+
wandb_runs = [f"{i}_{formatted_datetime}" for i in list(results.keys())]
|
| 138 |
+
|
| 139 |
+
for wandb_run_name, result in zip(wandb_runs, results.values()):
|
| 140 |
+
self.wandb_run(result = result,
|
| 141 |
+
wandb_run_name = wandb_run_name,
|
| 142 |
+
wandb_project = wandb_project,
|
| 143 |
+
debug = debug)
|
| 144 |
+
|
| 145 |
+
def wandb_run(self, result, wandb_run_name, wandb_project, debug):
|
| 146 |
+
|
| 147 |
run = wandb.init(
|
| 148 |
project=wandb_project,
|
| 149 |
name=f"evaluation-{formatted_datetime}",
|