Update app.py
Browse files
app.py
CHANGED
@@ -217,5 +217,23 @@ def load_html():
|
|
217 |
|
218 |
with gr.Blocks() as app:
|
219 |
html = gr.HTML()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
app.load(load_html,None,html)
|
221 |
app.launch()
|
|
|
217 |
|
218 |
with gr.Blocks() as app:
|
219 |
html = gr.HTML()
|
220 |
+
|
221 |
+
chatbot=gr.Chatbot()
|
222 |
+
msg = gr.Textbox()
|
223 |
+
with gr.Row():
|
224 |
+
submit_b = gr.Button()
|
225 |
+
stop_b = gr.Button("Stop")
|
226 |
+
clear = gr.ClearButton([msg, chatbot])
|
227 |
+
sumbox=gr.Textbox("Summary", max_lines=100)
|
228 |
+
with gr.Column():
|
229 |
+
sum_out_box=gr.JSON(label="Summaries")
|
230 |
+
hist_out_box=gr.JSON(label="History")
|
231 |
+
|
232 |
+
sub_b = submit_b.click(generate, [msg,chatbot],[msg,chatbot,sumbox,sum_out_box,hist_out_box])
|
233 |
+
sub_e = msg.submit(generate, [msg, chatbot], [msg, chatbot,sumbox,sum_out_box,hist_out_box])
|
234 |
+
stop_b.click(None,None,None, cancels=[sub_b,sub_e])
|
235 |
+
|
236 |
+
|
237 |
+
|
238 |
app.load(load_html,None,html)
|
239 |
app.launch()
|