rwitz commited on
Commit
a44076e
1 Parent(s): 6a93857

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -13,7 +13,7 @@ with open('chatbot_urls.json', 'r') as file:
13
  def clear_chat(state):
14
  if state is not None:
15
  state = {}
16
- return state, None,None,gr.Button.update(interactive=False),gr.Button.update(interactive=False)
17
 
18
 
19
 
@@ -180,7 +180,7 @@ with gr.Blocks() as demo:
180
  with gr.Row():
181
  submit_btn = gr.Button(value="Send")
182
  reset_btn = gr.Button(value="Reset")
183
- reset_btn.click(clear_chat, inputs=[state], outputs=[state, chatbot1, chatbot2, upvote_btn_a, upvote_btn_b])
184
  textbox.submit(user_ask, inputs=[state, chatbot1, chatbot2, textbox], outputs=[state, chatbot1, chatbot2, textbox,upvote_btn_a,upvote_btn_b])
185
  submit_btn.click(user_ask, inputs=[state, chatbot1, chatbot2, textbox], outputs=[state, chatbot1, chatbot2, textbox,upvote_btn_a,upvote_btn_b])
186
  upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1,chatbot2], outputs=[chatbot1,chatbot2,upvote_btn_a,upvote_btn_b,textbox,submit_btn])
 
13
  def clear_chat(state):
14
  if state is not None:
15
  state = {}
16
+ return state, None,None,gr.Button.update(interactive=False),gr.Button.update(interactive=False),gr.Textbox.update(interactive=False),gr.Button.update(interactive=False)
17
 
18
 
19
 
 
180
  with gr.Row():
181
  submit_btn = gr.Button(value="Send")
182
  reset_btn = gr.Button(value="Reset")
183
+ reset_btn.click(clear_chat, inputs=[state], outputs=[state, chatbot1, chatbot2, upvote_btn_a, upvote_btn_b,textbox,submit_btn])
184
  textbox.submit(user_ask, inputs=[state, chatbot1, chatbot2, textbox], outputs=[state, chatbot1, chatbot2, textbox,upvote_btn_a,upvote_btn_b])
185
  submit_btn.click(user_ask, inputs=[state, chatbot1, chatbot2, textbox], outputs=[state, chatbot1, chatbot2, textbox,upvote_btn_a,upvote_btn_b])
186
  upvote_btn_a.click(vote_up_model, inputs=[state, chatbot1,chatbot2], outputs=[chatbot1,chatbot2,upvote_btn_a,upvote_btn_b,textbox,submit_btn])