rwitz commited on
Commit
c99b95e
·
1 Parent(s): 0eb4a58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -28,7 +28,7 @@ def get_user_elo_ratings():
28
  elo_ratings = dataset['train'] # or the relevant split
29
  return elo_ratings
30
 
31
- def update_elo_rating(new_rating):
32
  # Fetch the current dataset
33
  elo_ratings = get_user_elo_ratings()
34
 
@@ -36,6 +36,7 @@ def update_elo_rating(new_rating):
36
 
37
  # Update the dataset
38
  # Convert updated dataset to a dictionary for pushing
 
39
  elo_ratings.push_to_hub("rwitz/mistral-elo-ratings",token=os.environ.get("huggingface_token"))
40
 
41
  # Function to get bot response
@@ -97,7 +98,7 @@ def update_ratings(state, winner_index):
97
  loser = state['last_bots'][1 - winner_index]
98
 
99
  elo_ratings = update_elo_ratings(elo_ratings, winner, loser)
100
- update_elo_rating(elo_ratings)
101
  return [('Winner: ',state['last_bots'][winner_index]),('Loser: ',state['last_bots'][1 - winner_index])]
102
 
103
  def vote_up_model(state, chatbot,chatbot2):
 
28
  elo_ratings = dataset['train'] # or the relevant split
29
  return elo_ratings
30
 
31
+ def update_elo_rating(new_rating,winner,loser):
32
  # Fetch the current dataset
33
  elo_ratings = get_user_elo_ratings()
34
 
 
36
 
37
  # Update the dataset
38
  # Convert updated dataset to a dictionary for pushing
39
+ updated_ratings=update_elo_ratings(elo_ratings,winner,loser)
40
  elo_ratings.push_to_hub("rwitz/mistral-elo-ratings",token=os.environ.get("huggingface_token"))
41
 
42
  # Function to get bot response
 
98
  loser = state['last_bots'][1 - winner_index]
99
 
100
  elo_ratings = update_elo_ratings(elo_ratings, winner, loser)
101
+ update_elo_rating(elo_ratings,winner,loser)
102
  return [('Winner: ',state['last_bots'][winner_index]),('Loser: ',state['last_bots'][1 - winner_index])]
103
 
104
  def vote_up_model(state, chatbot,chatbot2):