rwitz commited on
Commit
83d0c0a
1 Parent(s): c958824

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -52,7 +52,7 @@ def chat_with_bots(user_input, state):
52
  bot1_url, bot2_url = chatbots[bot_names[0]], chatbots[bot_names[1]]
53
 
54
  # Update the state with the names of the last bots
55
- state.update({'last_bots': [bot_names[0], bot_names[1]]})
56
 
57
  bot1_response = get_bot_response(bot1_url, user_input)
58
  bot2_response = get_bot_response(bot2_url, user_input)
@@ -94,7 +94,7 @@ def user_ask(state, chatbot1, chatbot2, textbox):
94
  upvote_btn_b.interactive = True
95
 
96
  updated_elo_ratings = get_user_elo_ratings(state)
97
- state.update({'elo_ratings': updated_elo_ratings})
98
  return state, chatbot1, chatbot2
99
 
100
  # ... [Rest of your existing functions] ...
@@ -102,7 +102,7 @@ def user_ask(state, chatbot1, chatbot2, textbox):
102
 
103
  with gr.Blocks() as demo:
104
  state = gr.State({})
105
- state.update({"elo_ratings":read_elo_ratings})
106
  with gr.Row():
107
  # First column for Model A
108
  with gr.Column():
 
52
  bot1_url, bot2_url = chatbots[bot_names[0]], chatbots[bot_names[1]]
53
 
54
  # Update the state with the names of the last bots
55
+ state=state.value.update({'last_bots': [bot_names[0], bot_names[1]]})
56
 
57
  bot1_response = get_bot_response(bot1_url, user_input)
58
  bot2_response = get_bot_response(bot2_url, user_input)
 
94
  upvote_btn_b.interactive = True
95
 
96
  updated_elo_ratings = get_user_elo_ratings(state)
97
+ state=state.value.update({'elo_ratings': updated_elo_ratings})
98
  return state, chatbot1, chatbot2
99
 
100
  # ... [Rest of your existing functions] ...
 
102
 
103
  with gr.Blocks() as demo:
104
  state = gr.State({})
105
+ state=state.value.update({"elo_ratings":read_elo_ratings})
106
  with gr.Row():
107
  # First column for Model A
108
  with gr.Column():