woters commited on
Commit
1de490b
·
1 Parent(s): 1acb2f0
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -192,7 +192,7 @@ def fetch_and_format_leaderboard():
192
  # Sort the leaderboard by elo_rating in descending order
193
  leaderboard.sort(key=lambda x: x['win_rate'], reverse=True)
194
  leaderboard_df = pd.DataFrame(leaderboard)
195
- leaderboard_df['Rank'] = leaderboard_df['win_rate'].rank(method='max', ascending=False).astype(int)
196
 
197
  # Reorder columns to match your requirement
198
  leaderboard_df = leaderboard_df[['Rank', 'model', 'win_rate', 'elo_rating'
@@ -247,9 +247,12 @@ models = ['codekobzar','gpt-4','llama-2-70b-chat','sherlock-no-rag','sherlock-ra
247
  votes_ref = db.collection('votes')
248
  for model in models:
249
  vote_doc = votes_ref.document(model).get()
250
- votes_ref.document(model).set({'win_count': 0})
251
- votes_ref.document(model).set({'loss_count': 0})
252
- votes_ref.document(model).set({'elo_rating': 25})
 
 
 
253
 
254
 
255
 
 
192
  # Sort the leaderboard by elo_rating in descending order
193
  leaderboard.sort(key=lambda x: x['win_rate'], reverse=True)
194
  leaderboard_df = pd.DataFrame(leaderboard)
195
+ leaderboard_df['Rank'] = [1,2,3,4,5,6,7]#leaderboard_df['win_rate'].rank(method='max', ascending=False).astype(int)
196
 
197
  # Reorder columns to match your requirement
198
  leaderboard_df = leaderboard_df[['Rank', 'model', 'win_rate', 'elo_rating'
 
247
  votes_ref = db.collection('votes')
248
  for model in models:
249
  vote_doc = votes_ref.document(model).get()
250
+ if vote_doc.exists:
251
+ print("-------")
252
+ else:
253
+ votes_ref.document(model).set({'win_count': 0})
254
+ votes_ref.document(model).set({'loss_count': 0})
255
+ votes_ref.document(model).set({'elo_rating': 25})
256
 
257
 
258