jchen8000 commited on
Commit
46576f4
·
verified ·
1 Parent(s): 10c4a8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -103,14 +103,15 @@ def clear_chat():
103
  return None
104
 
105
  with gr.Blocks(fill_width=True, fill_height=True) as demo:
106
- gr.ChatInterface(
107
  fn=generate_response,
108
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
109
  additional_inputs=additional_inputs,
110
  examples=example1,
111
  cache_examples=False,
112
- )
113
- clear_button = gr.Button("Clear chat history and Start a new chat")
114
- clear_button.click(clear_chat, inputs=None, outputs=None)
 
115
 
116
  demo.launch()
 
103
  return None
104
 
105
  with gr.Blocks(fill_width=True, fill_height=True) as demo:
106
+ ci= gr.ChatInterface(
107
  fn=generate_response,
108
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
109
  additional_inputs=additional_inputs,
110
  examples=example1,
111
  cache_examples=False,
112
+ )
113
+ ci.clear_btn.click(clear_chat)
114
+ # clear_button = gr.Button("Clear chat history and Start a new chat")
115
+ # clear_button.click(clear_chat, inputs=None, outputs=None)
116
 
117
  demo.launch()