Elouarn commited on
Commit
ce29588
·
verified ·
1 Parent(s): 79336b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -251,7 +251,7 @@ def handle_accuse_click(request=None):
251
  else:
252
  return generate("", True, "", request)
253
 
254
- def chatbot_interface(request=None, accuse_btn=None):
255
  chatbot_interface = gr.ChatInterface(
256
  fn=generate,
257
  chatbot=mychatbot,
@@ -264,7 +264,8 @@ def chatbot_interface(request=None, accuse_btn=None):
264
  css="footer {visibility: hidden !important} .gradio-container {background-color: #2D4059 !important; color: #FFD460 !important;}",
265
  js=js_func
266
  )
267
- accuse_btn.click(handle_accuse_click, inputs=[request], outputs=[])
 
268
  return chatbot_interface
269
 
270
 
 
251
  else:
252
  return generate("", True, "", request)
253
 
254
+ def chatbot_interface(request: gr.Request, accuse_btn: gr.Button):
255
  chatbot_interface = gr.ChatInterface(
256
  fn=generate,
257
  chatbot=mychatbot,
 
264
  css="footer {visibility: hidden !important} .gradio-container {background-color: #2D4059 !important; color: #FFD460 !important;}",
265
  js=js_func
266
  )
267
+ if request is not None:
268
+ accuse_btn.click(handle_accuse_click, inputs=[request], outputs=[])
269
  return chatbot_interface
270
 
271