Spaces:
Runtime error
Runtime error
Try to highlight wins
Browse files
server.py
CHANGED
@@ -216,6 +216,17 @@ class LeaderboardServer:
|
|
216 |
self.submission_id_to_file[submission_id] = submission_file
|
217 |
self.submission_id_to_model_title[submission_id] = metadata["team_name"] + "/" + metadata["model_name"]
|
218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
def get_model_tournament_table(self, submission_id, category):
|
220 |
if category == self.TASKS_CATEGORY_OVERALL:
|
221 |
return None
|
@@ -270,7 +281,8 @@ class LeaderboardServer:
|
|
270 |
dataframe = dataframe.rename(
|
271 |
columns=attributes_map_word_to_header
|
272 |
)
|
273 |
-
dataframe.style.
|
|
|
274 |
return dataframe
|
275 |
|
276 |
def get_leaderboard(self, pre_submit=None, category=None):
|
|
|
216 |
self.submission_id_to_file[submission_id] = submission_file
|
217 |
self.submission_id_to_model_title[submission_id] = metadata["team_name"] + "/" + metadata["model_name"]
|
218 |
|
219 |
+
def _model_tournament_table_format(self, c):
|
220 |
+
if isinstance(c, int):
|
221 |
+
return bool(c)
|
222 |
+
else:
|
223 |
+
return c
|
224 |
+
|
225 |
+
def _model_tournament_table_styler_pipe(self, styler):
|
226 |
+
styler.format(self._model_tournament_table_format)
|
227 |
+
styler.highlight_max(color='lightgreen', axis=None)
|
228 |
+
return styler
|
229 |
+
|
230 |
def get_model_tournament_table(self, submission_id, category):
|
231 |
if category == self.TASKS_CATEGORY_OVERALL:
|
232 |
return None
|
|
|
281 |
dataframe = dataframe.rename(
|
282 |
columns=attributes_map_word_to_header
|
283 |
)
|
284 |
+
#dataframe.style.format(self._model_tournament_table_styler)
|
285 |
+
dataframe.style.highlight_max(color='lightgreen', axis=None)
|
286 |
return dataframe
|
287 |
|
288 |
def get_leaderboard(self, pre_submit=None, category=None):
|