rwitz commited on
Commit
227a710
·
verified ·
1 Parent(s): e1ddfc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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)