Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -192,8 +192,9 @@ def generate_leaderboard(collection):
|
|
192 |
rows = list(collection.find())
|
193 |
leaderboard_data = pd.DataFrame(rows, columns=['bot_name', 'elo_rating', 'games_played'])
|
194 |
leaderboard_data.columns = ['Chatbot', 'ELO Score', 'Games Played']
|
|
|
|
|
195 |
return leaderboard_data
|
196 |
-
|
197 |
def refresh_leaderboard():
|
198 |
collection = init_database()
|
199 |
return generate_leaderboard(collection)
|
|
|
192 |
rows = list(collection.find())
|
193 |
leaderboard_data = pd.DataFrame(rows, columns=['bot_name', 'elo_rating', 'games_played'])
|
194 |
leaderboard_data.columns = ['Chatbot', 'ELO Score', 'Games Played']
|
195 |
+
leaderboard_data['ELO Score'] = leaderboard_data['ELO Score'].round().astype(int)
|
196 |
+
leaderboard_data = leaderboard_data.sort_values('ELO Score', ascending=False)
|
197 |
return leaderboard_data
|
|
|
198 |
def refresh_leaderboard():
|
199 |
collection = init_database()
|
200 |
return generate_leaderboard(collection)
|