Spaces:
Runtime error
Runtime error
task_metric 2 abbreviation_metric
Browse files
server.py
CHANGED
@@ -92,6 +92,7 @@ class LeaderboardServer:
|
|
92 |
raise gr.Error(f"Proper submission [{submission_id}] not found")
|
93 |
|
94 |
local_results = {}
|
|
|
95 |
for task in self.tasks_metadata.keys():
|
96 |
|
97 |
# tournament_results
|
@@ -101,6 +102,7 @@ class LeaderboardServer:
|
|
101 |
local_results[task] += 1
|
102 |
|
103 |
for metric in VISIBLE_METRICS:
|
|
|
104 |
metric_value = data['results'][task].get(metric)
|
105 |
if metric_value is not None:
|
106 |
local_results[task + "_" + metric] = metric_value
|
@@ -153,6 +155,7 @@ class LeaderboardServer:
|
|
153 |
dataframe = dataframe[df_order]
|
154 |
attributes_map_word_to_header = {key: value["abbreviation"] for key, value in self.tasks_metadata.items()}
|
155 |
attributes_map_word_to_header.update(extra_attributes_map_word_to_header)
|
|
|
156 |
dataframe = dataframe.rename(
|
157 |
columns=attributes_map_word_to_header
|
158 |
)
|
|
|
92 |
raise gr.Error(f"Proper submission [{submission_id}] not found")
|
93 |
|
94 |
local_results = {}
|
95 |
+
visible_metrics_map_word_to_header = {}
|
96 |
for task in self.tasks_metadata.keys():
|
97 |
|
98 |
# tournament_results
|
|
|
102 |
local_results[task] += 1
|
103 |
|
104 |
for metric in VISIBLE_METRICS:
|
105 |
+
visible_metrics_map_word_to_header[task + "_" + metric] = self.tasks_metadata[task]["abbreviation"] + " " + metric
|
106 |
metric_value = data['results'][task].get(metric)
|
107 |
if metric_value is not None:
|
108 |
local_results[task + "_" + metric] = metric_value
|
|
|
155 |
dataframe = dataframe[df_order]
|
156 |
attributes_map_word_to_header = {key: value["abbreviation"] for key, value in self.tasks_metadata.items()}
|
157 |
attributes_map_word_to_header.update(extra_attributes_map_word_to_header)
|
158 |
+
attributes_map_word_to_header.update(visible_metrics_map_word_to_header)
|
159 |
dataframe = dataframe.rename(
|
160 |
columns=attributes_map_word_to_header
|
161 |
)
|