rwitz commited on
Commit
c31f1de
1 Parent(s): a44076e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -154,15 +154,19 @@ def generate_leaderboard():
154
  # Convert the Hugging Face dataset to a pandas DataFrame
155
  leaderboard_data = pd.DataFrame(elo_ratings_dataset)
156
 
157
- # Assuming the dataset has columns 'bot_name' and 'elo_rating'
158
  leaderboard_data.columns = ['Chatbot', 'ELO Score']
159
 
 
 
 
160
  # Sort the DataFrame based on the ELO Score in descending order
161
  leaderboard_data = leaderboard_data.sort_values('ELO Score', ascending=False)
162
 
163
  return leaderboard_data
164
 
165
 
 
166
  # Gradio interface setup
167
  with gr.Blocks() as demo:
168
  state = gr.State({})
 
154
  # Convert the Hugging Face dataset to a pandas DataFrame
155
  leaderboard_data = pd.DataFrame(elo_ratings_dataset)
156
 
157
+ # Rename columns to 'Chatbot' and 'ELO Score'
158
  leaderboard_data.columns = ['Chatbot', 'ELO Score']
159
 
160
+ # Round the ELO Score to the nearest whole number
161
+ leaderboard_data['ELO Score'] = leaderboard_data['ELO Score'].round()
162
+
163
  # Sort the DataFrame based on the ELO Score in descending order
164
  leaderboard_data = leaderboard_data.sort_values('ELO Score', ascending=False)
165
 
166
  return leaderboard_data
167
 
168
 
169
+
170
  # Gradio interface setup
171
  with gr.Blocks() as demo:
172
  state = gr.State({})