Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -90,6 +90,7 @@ def user_ask(state, chatbot1, chatbot2, textbox, upvote_btn_a, upvote_btn_b):
|
|
90 |
chatbot2.append("Bot 2: " + bot2_response)
|
91 |
|
92 |
# Enable voting buttons
|
|
|
93 |
upvote_btn_a.interactive = True
|
94 |
upvote_btn_b.interactive = True
|
95 |
|
@@ -118,8 +119,8 @@ with gr.Blocks() as demo:
|
|
118 |
submit_btn = gr.Button(value="Send")
|
119 |
|
120 |
# Interaction logic
|
121 |
-
textbox.submit(user_ask, inputs=[state, chatbot1, chatbot2, textbox
|
122 |
-
submit_btn.click(user_ask, inputs=[state, chatbot1, chatbot2, textbox
|
123 |
upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1], outputs=[chatbot1])
|
124 |
upvote_btn_b.click(vote_up_model, inputs=[state, chatbot2], outputs=[chatbot2])
|
125 |
|
|
|
90 |
chatbot2.append("Bot 2: " + bot2_response)
|
91 |
|
92 |
# Enable voting buttons
|
93 |
+
global upvote_btn_a,upvote_btn_b
|
94 |
upvote_btn_a.interactive = True
|
95 |
upvote_btn_b.interactive = True
|
96 |
|
|
|
119 |
submit_btn = gr.Button(value="Send")
|
120 |
|
121 |
# Interaction logic
|
122 |
+
textbox.submit(user_ask, inputs=[state, chatbot1, chatbot2, textbox], outputs=[state, chatbot1, chatbot2])
|
123 |
+
submit_btn.click(user_ask, inputs=[state, chatbot1, chatbot2, textbox], outputs=[state, chatbot1, chatbot2])
|
124 |
upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1], outputs=[chatbot1])
|
125 |
upvote_btn_b.click(vote_up_model, inputs=[state, chatbot2], outputs=[chatbot2])
|
126 |
|