rwitz commited on
Commit
fa1169f
1 Parent(s): 1b8f04a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -91,17 +91,17 @@ def update_ratings(state, winner_index):
91
 
92
  elo_ratings = update_elo_ratings(elo_ratings, winner, loser)
93
  write_elo_ratings(elo_ratings)
94
- return ['Winner: '+state['last_bots'][winner_index],'Loser: '+state['last_bots'][1 - winner_index]]
95
 
96
  def vote_up_model(state, chatbot,chatbot2):
97
  update_message = update_ratings(state, 0)
98
- chatbot.append((update_message[0]))
99
- chatbot2.append((update_message[1]))
100
  return chatbot, chatbot2,gr.Button.update(interactive=False),gr.Button.update(interactive=False),gr.Textbox.update(interactive=False),gr.Button.update(interactive=False) # Disable voting buttons
101
  def vote_down_model(state, chatbot,chatbot2):
102
  update_message = update_ratings(state, 1)
103
- chatbot2.append((update_message[0]))
104
- chatbot.append((update_message[1]))
105
  return chatbot,chatbot2, gr.Button.update(interactive=False),gr.Button.update(interactive=False),gr.Textbox.update(interactive=False),gr.Button.update(interactive=False) # Disable voting buttons
106
 
107
  def user_ask(state, chatbot1, chatbot2, textbox):
 
91
 
92
  elo_ratings = update_elo_ratings(elo_ratings, winner, loser)
93
  write_elo_ratings(elo_ratings)
94
+ return [('Winner: ',state['last_bots'][winner_index]),('Loser: ',state['last_bots'][1 - winner_index])]
95
 
96
  def vote_up_model(state, chatbot,chatbot2):
97
  update_message = update_ratings(state, 0)
98
+ chatbot.append(update_message[0])
99
+ chatbot2.append(update_message[1])
100
  return chatbot, chatbot2,gr.Button.update(interactive=False),gr.Button.update(interactive=False),gr.Textbox.update(interactive=False),gr.Button.update(interactive=False) # Disable voting buttons
101
  def vote_down_model(state, chatbot,chatbot2):
102
  update_message = update_ratings(state, 1)
103
+ chatbot2.append(update_message[0])
104
+ chatbot.append(update_message[1])
105
  return chatbot,chatbot2, gr.Button.update(interactive=False),gr.Button.update(interactive=False),gr.Textbox.update(interactive=False),gr.Button.update(interactive=False) # Disable voting buttons
106
 
107
  def user_ask(state, chatbot1, chatbot2, textbox):