Spaces:
Runtime error
Runtime error
Added more match details
Browse files
server.py
CHANGED
@@ -247,10 +247,10 @@ class LeaderboardServer:
|
|
247 |
for task in self.tournament_results[submission_id][competitor_id]:
|
248 |
task_category = self.TASKS_METADATA[task]["category"]
|
249 |
if task_category == category:
|
250 |
-
|
251 |
-
|
252 |
-
match_task_result_significant =
|
253 |
-
match_task_result_details = f"
|
254 |
match_results[task] = f'<abbr title={xmlQuoteAttr(match_task_result_details)}>{match_task_result_significant}</abbr>'
|
255 |
|
256 |
model_link = data["metadata"]["link_to_model"]
|
@@ -328,7 +328,7 @@ class LeaderboardServer:
|
|
328 |
num_of_wins = 0
|
329 |
for competitor_id in tournament_results[submission_id].keys() - {submission_id}: # without self
|
330 |
num_of_competitors += 1
|
331 |
-
if tournament_results[submission_id][competitor_id][task]:
|
332 |
num_of_wins += 1
|
333 |
task_score = num_of_wins / num_of_competitors * 100 if num_of_competitors > 0 else 100
|
334 |
win_score.setdefault(task_category, []).append(task_score)
|
@@ -448,12 +448,8 @@ class LeaderboardServer:
|
|
448 |
result_url[new_competitor_id] = check_significance_send_task(new_model_file, self.submission_id_to_file[new_competitor_id])
|
449 |
result_inverse_url[new_competitor_id] = check_significance_send_task(self.submission_id_to_file[new_competitor_id], new_model_file)
|
450 |
|
451 |
-
new_tournament[new_submission_id][competitor_id] =
|
452 |
-
|
453 |
-
}
|
454 |
-
new_tournament[competitor_id][new_submission_id] = {
|
455 |
-
task: data["significant"] for task, data in result_inverse.items()
|
456 |
-
}
|
457 |
|
458 |
num_of_competitors_done = num_of_competitors - len(next_competitors) - len(rest_of_competitors)
|
459 |
gr.Info(f"Tournament: {num_of_competitors_done}/{num_of_competitors} = {(num_of_competitors_done) * 100 // num_of_competitors}% done")
|
|
|
247 |
for task in self.tournament_results[submission_id][competitor_id]:
|
248 |
task_category = self.TASKS_METADATA[task]["category"]
|
249 |
if task_category == category:
|
250 |
+
match_task_result_details = copy.deepcopy(self.tournament_results[submission_id][competitor_id][task])
|
251 |
+
match_task_result_details["significant"] = str(match_task_result_details["significant"]).lower() # originaly bool
|
252 |
+
match_task_result_significant = match_task_result_details["significant"]
|
253 |
+
match_task_result_details = "\n".join(f"{k}: {v}" for k, v in match_task_result_details)
|
254 |
match_results[task] = f'<abbr title={xmlQuoteAttr(match_task_result_details)}>{match_task_result_significant}</abbr>'
|
255 |
|
256 |
model_link = data["metadata"]["link_to_model"]
|
|
|
328 |
num_of_wins = 0
|
329 |
for competitor_id in tournament_results[submission_id].keys() - {submission_id}: # without self
|
330 |
num_of_competitors += 1
|
331 |
+
if tournament_results[submission_id][competitor_id][task]["significant"]:
|
332 |
num_of_wins += 1
|
333 |
task_score = num_of_wins / num_of_competitors * 100 if num_of_competitors > 0 else 100
|
334 |
win_score.setdefault(task_category, []).append(task_score)
|
|
|
448 |
result_url[new_competitor_id] = check_significance_send_task(new_model_file, self.submission_id_to_file[new_competitor_id])
|
449 |
result_inverse_url[new_competitor_id] = check_significance_send_task(self.submission_id_to_file[new_competitor_id], new_model_file)
|
450 |
|
451 |
+
new_tournament[new_submission_id][competitor_id] = result
|
452 |
+
new_tournament[competitor_id][new_submission_id] = result_inverse
|
|
|
|
|
|
|
|
|
453 |
|
454 |
num_of_competitors_done = num_of_competitors - len(next_competitors) - len(rest_of_competitors)
|
455 |
gr.Info(f"Tournament: {num_of_competitors_done}/{num_of_competitors} = {(num_of_competitors_done) * 100 // num_of_competitors}% done")
|