Spaces:
Running
Running
Prepare tournament dataframes
Browse files
server.py
CHANGED
@@ -196,6 +196,20 @@ class LeaderboardServer:
|
|
196 |
}
|
197 |
with self.var_lock.rw:
|
198 |
self.leaderboard_dataframes = leaderboard_dataframes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
def load_tournament_results(self):
|
201 |
with self.results_dataset_local_snapshot_lock.ro:
|
@@ -334,6 +348,10 @@ class LeaderboardServer:
|
|
334 |
return df_css
|
335 |
|
336 |
def get_model_tournament_table(self, submission_id, category):
|
|
|
|
|
|
|
|
|
337 |
if category == self.TASKS_CATEGORY_OVERALL:
|
338 |
return None
|
339 |
|
|
|
196 |
}
|
197 |
with self.var_lock.rw:
|
198 |
self.leaderboard_dataframes = leaderboard_dataframes
|
199 |
+
|
200 |
+
with self.var_lock.ro:
|
201 |
+
submission_ids = self.submission_ids
|
202 |
+
|
203 |
+
tournament_dataframes = {
|
204 |
+
submission_id: {
|
205 |
+
category: self._get_model_tournament_table(submission_id, category)
|
206 |
+
for category in [self.TASKS_CATEGORY_OVERALL] + sorted(self.TASKS_CATEGORIES)
|
207 |
+
}
|
208 |
+
for submission_id in submission_ids
|
209 |
+
}
|
210 |
+
|
211 |
+
with self.var_lock.rw:
|
212 |
+
self.tournament_dataframes = tournament_dataframes
|
213 |
|
214 |
def load_tournament_results(self):
|
215 |
with self.results_dataset_local_snapshot_lock.ro:
|
|
|
348 |
return df_css
|
349 |
|
350 |
def get_model_tournament_table(self, submission_id, category):
|
351 |
+
with self.var_lock.ro:
|
352 |
+
return copy.copy(self.tournament_dataframes[submission_id][category])
|
353 |
+
|
354 |
+
def _get_model_tournament_table(self, submission_id, category):
|
355 |
if category == self.TASKS_CATEGORY_OVERALL:
|
356 |
return None
|
357 |
|