rwitz commited on
Commit
aaec9a5
1 Parent(s): d649f74

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -84,7 +84,7 @@ def vote_down_model(state, chatbot):
84
  update_message = update_ratings(state, 1)
85
  chatbot.append(update_message)
86
  return chatbot
87
- def user_ask(state, chatbot1, chatbot2, textbox):
88
  user_input = textbox.value
89
  bot1_response, bot2_response = chat_with_bots(user_input)
90
 
@@ -95,7 +95,12 @@ def user_ask(state, chatbot1, chatbot2, textbox):
95
  chatbot2.append("Bot 2: " + bot2_response['output'])
96
 
97
  state['last_bots'] = [bot1_response['model_name'], bot2_response['model_name']]
98
- return state, chatbot1, chatbot2, ""
 
 
 
 
 
99
 
100
  # ... [Rest of your existing functions] ...
101
  state = gr.State({})
 
84
  update_message = update_ratings(state, 1)
85
  chatbot.append(update_message)
86
  return chatbot
87
+ def user_ask(state, chatbot1, chatbot2, textbox, upvote_btn_a, upvote_btn_b):
88
  user_input = textbox.value
89
  bot1_response, bot2_response = chat_with_bots(user_input)
90
 
 
95
  chatbot2.append("Bot 2: " + bot2_response['output'])
96
 
97
  state['last_bots'] = [bot1_response['model_name'], bot2_response['model_name']]
98
+
99
+ # Enable voting buttons
100
+ upvote_btn_a.interactive = True
101
+ upvote_btn_b.interactive = True
102
+
103
+ return state, chatbot1, chatbot2, "", upvote_btn_a, upvote_btn_b
104
 
105
  # ... [Rest of your existing functions] ...
106
  state = gr.State({})