Elouarn commited on
Commit
ceda749
·
verified ·
1 Parent(s): 5b84809

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -245,7 +245,7 @@ mychatbot = gr.Chatbot(
245
  )
246
 
247
 
248
- def chatbot_interface(request: gr.Request):
249
  chatbot_interface = gr.ChatInterface(
250
  fn=generate,
251
  chatbot=mychatbot,
@@ -254,6 +254,7 @@ def chatbot_interface(request: gr.Request):
254
  undo_btn=None,
255
  clear_btn=None,
256
  submit_btn="Parler",
 
257
  css="footer {visibility: hidden !important} .gradio-container {background-color: #2D4059 !important; color: #FFD460 !important;}",
258
  js=js_func
259
  )
@@ -261,8 +262,9 @@ def chatbot_interface(request: gr.Request):
261
 
262
 
263
  def main(request: gr.Request):
264
- with gr.Blocks() as demo:
265
- chat_interface = chatbot_interface(request)
 
266
  accuse_btn = gr.Button("Accuser")
267
 
268
  demo.launch(show_api=False, inline=True)
 
245
  )
246
 
247
 
248
+ def chatbot_interface(request: gr.Request, accuse_btn: gr.Button):
249
  chatbot_interface = gr.ChatInterface(
250
  fn=generate,
251
  chatbot=mychatbot,
 
254
  undo_btn=None,
255
  clear_btn=None,
256
  submit_btn="Parler",
257
+ additionnal_inputs=[accuse_btn]
258
  css="footer {visibility: hidden !important} .gradio-container {background-color: #2D4059 !important; color: #FFD460 !important;}",
259
  js=js_func
260
  )
 
262
 
263
 
264
  def main(request: gr.Request):
265
+ with gr.Blocks(css="footer {visibility: hidden !important} .gradio-container {background-color: #2D4059 !important; color: #FFD460 !important;}",
266
+ js=js_func) as demo:
267
+ chat_interface = chatbot_interface(request, accuse_btn)
268
  accuse_btn = gr.Button("Accuser")
269
 
270
  demo.launch(show_api=False, inline=True)