Spaces:
Running
Running
Use specified metric for every task
Browse files
server.py
CHANGED
@@ -58,6 +58,13 @@ MARKDOWN_SPECIAL_CHARACTERS = {
|
|
58 |
"|": "|"
|
59 |
}
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
def xmlAndMarkdownEscape(text):
|
62 |
return xmlEscape(text, MARKDOWN_SPECIAL_CHARACTERS)
|
63 |
|
@@ -649,7 +656,7 @@ class LeaderboardServer:
|
|
649 |
|
650 |
if category in (task_category, self.TASKS_CATEGORY_OVERALL_DETAILS):
|
651 |
local_results[task] = task_score
|
652 |
-
for metric in VISIBLE_METRICS:
|
653 |
visible_metrics_map_word_to_header[task + "_" + metric] = self.TASKS_METADATA[task]["abbreviation"] + " " + metric
|
654 |
metric_value = data['results'][task].get(metric)
|
655 |
if metric_value is not None:
|
|
|
58 |
"|": "|"
|
59 |
}
|
60 |
|
61 |
+
def uniqifyList(seq, order_preserving=True):
|
62 |
+
if order_preserving:
|
63 |
+
seen = set()
|
64 |
+
return [x for x in seq if x not in seen and not seen.add(x)]
|
65 |
+
else:
|
66 |
+
return list(set(seq))
|
67 |
+
|
68 |
def xmlAndMarkdownEscape(text):
|
69 |
return xmlEscape(text, MARKDOWN_SPECIAL_CHARACTERS)
|
70 |
|
|
|
656 |
|
657 |
if category in (task_category, self.TASKS_CATEGORY_OVERALL_DETAILS):
|
658 |
local_results[task] = task_score
|
659 |
+
for metric in uniqifyList([self.TASKS_METADATA[task]["metric"]] + VISIBLE_METRICS):
|
660 |
visible_metrics_map_word_to_header[task + "_" + metric] = self.TASKS_METADATA[task]["abbreviation"] + " " + metric
|
661 |
metric_value = data['results'][task].get(metric)
|
662 |
if metric_value is not None:
|