alexkueck commited on
Commit
0fb8589
1 Parent(s): 3cea298

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -107,7 +107,11 @@ def reset_chat():
107
  #id_new = chatbot.new_conversation()
108
  #chatbot.change_conversation(id_new)
109
  reset_textbox()
110
-
 
 
 
 
111
 
112
  ##########################################################
113
  #Übersetzungs Ki nutzen
@@ -238,6 +242,10 @@ with gr.Blocks(theme=small_and_beautiful_theme) as demo:
238
  )
239
  emptyBtn.click(**reset_args)
240
 
 
 
 
 
241
  demo.title = "LI Chat"
242
  #demo.queue(concurrency_count=1).launch(share=True)
243
  demo.queue(concurrency_count=1).launch(debug=True)
 
107
  #id_new = chatbot.new_conversation()
108
  #chatbot.change_conversation(id_new)
109
  reset_textbox()
110
+
111
+ #wenn 'Stop' Button geklickt, dann Message dazu und das Eingabe-Fenster leeren
112
+ def cancel_outputing():
113
+ reset_textbox()
114
+ return "Stop Done"
115
 
116
  ##########################################################
117
  #Übersetzungs Ki nutzen
 
242
  )
243
  emptyBtn.click(**reset_args)
244
 
245
+ #Berechnung oder Ausgabe anhalten (kann danach fortgesetzt werden)
246
+ cancelBtn.click(cancel_outputing, [], [status_display], cancels=[predict_event1,predict_event2])
247
+ #cancelBtn.click(lambda: None, None, chatbotGr, queue=False)
248
+
249
  demo.title = "LI Chat"
250
  #demo.queue(concurrency_count=1).launch(share=True)
251
  demo.queue(concurrency_count=1).launch(debug=True)