Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
56 |
|
57 |
bot1_response = get_bot_response(bot1_url, user_input)
|
58 |
bot2_response = get_bot_response(bot2_url, user_input)
|
@@ -79,6 +79,7 @@ def vote_down_model(state, chatbot):
|
|
79 |
chatbot.append(update_message)
|
80 |
return chatbot
|
81 |
def user_ask(state, chatbot1, chatbot2, textbox):
|
|
|
82 |
user_input = textbox
|
83 |
bot1_response, bot2_response = chat_with_bots(user_input, state)
|
84 |
|
@@ -94,7 +95,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
|
98 |
return state, chatbot1, chatbot2
|
99 |
|
100 |
# ... [Rest of your existing functions] ...
|
@@ -102,7 +103,6 @@ def user_ask(state, chatbot1, chatbot2, textbox):
|
|
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():
|
|
|
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)
|
|
|
79 |
chatbot.append(update_message)
|
80 |
return chatbot
|
81 |
def user_ask(state, chatbot1, chatbot2, textbox):
|
82 |
+
state.update({"elo_ratings":read_elo_ratings})
|
83 |
user_input = textbox
|
84 |
bot1_response, bot2_response = chat_with_bots(user_input, state)
|
85 |
|
|
|
95 |
upvote_btn_b.interactive = True
|
96 |
|
97 |
updated_elo_ratings = get_user_elo_ratings(state)
|
98 |
+
state.update({'elo_ratings': updated_elo_ratings})
|
99 |
return state, chatbot1, chatbot2
|
100 |
|
101 |
# ... [Rest of your existing functions] ...
|
|
|
103 |
|
104 |
with gr.Blocks() as demo:
|
105 |
state = gr.State({})
|
|
|
106 |
with gr.Row():
|
107 |
# First column for Model A
|
108 |
with gr.Column():
|