Omnibus commited on
Commit
d7942b7
1 Parent(s): 49e3627

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -55,6 +55,8 @@ def chat_inf(system_prompt,prompt,history,client_choice):
55
  history.append((prompt,output))
56
  yield history
57
 
 
 
58
  with gr.Blocks() as app:
59
  with gr.Group():
60
  chat_b = gr.Chatbot()
@@ -69,7 +71,8 @@ with gr.Blocks() as app:
69
  stop_btn=gr.Button("Stop")
70
  clear_btn=gr.Button("Clear")
71
  client_choice=gr.Dropdown(label="Models",type='index',choices=[c for c in models],value=models[0],interactive=True)
 
72
  go=btn.click(chat_inf,[sys_inp,inp,chat_b,client_choice],chat_b)
73
  stop_btn.click(None,None,None,cancels=go)
74
-
75
  app.launch()
 
55
  history.append((prompt,output))
56
  yield history
57
 
58
+ def clear_fn():
59
+ return None,None,None
60
  with gr.Blocks() as app:
61
  with gr.Group():
62
  chat_b = gr.Chatbot()
 
71
  stop_btn=gr.Button("Stop")
72
  clear_btn=gr.Button("Clear")
73
  client_choice=gr.Dropdown(label="Models",type='index',choices=[c for c in models],value=models[0],interactive=True)
74
+
75
  go=btn.click(chat_inf,[sys_inp,inp,chat_b,client_choice],chat_b)
76
  stop_btn.click(None,None,None,cancels=go)
77
+ clear_btn.click(clear_fn,None,[inp,sys_inp,chat_b])
78
  app.launch()