Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
f8075da
1
Parent(s):
3f599cd
remove stale w/l calculation
Browse files- utils/leaderboard.py +4 -1
utils/leaderboard.py
CHANGED
|
@@ -394,8 +394,11 @@ def submit_vote_with_elo(m_a, m_b, winner, feedback, current_results):
|
|
| 394 |
print("Warning: Submit called without a winner selected.")
|
| 395 |
return {}
|
| 396 |
|
|
|
|
|
|
|
|
|
|
| 397 |
# Update Elo ratings
|
| 398 |
-
updated_results = update_elo_ratings(
|
| 399 |
|
| 400 |
# Update vote count
|
| 401 |
updated_results["votes"] = updated_results.get("votes", 0) + 1
|
|
|
|
| 394 |
print("Warning: Submit called without a winner selected.")
|
| 395 |
return {}
|
| 396 |
|
| 397 |
+
# Current results could be stale, reload from latest copy on non-persistent storage:
|
| 398 |
+
recent_results = load_leaderboard_data()
|
| 399 |
+
|
| 400 |
# Update Elo ratings
|
| 401 |
+
updated_results = update_elo_ratings(recent_results.copy(), m_a, m_b, winner)
|
| 402 |
|
| 403 |
# Update vote count
|
| 404 |
updated_results["votes"] = updated_results.get("votes", 0) + 1
|