alexkueck commited on
Commit
c793a2a
1 Parent(s): 173e482

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -176,6 +176,9 @@ def cancel_outputing():
176
 
177
  def reset_textbox():
178
  return gr.update(value=""),""
 
 
 
179
 
180
  ##########################################
181
  #Hilfsfunktion, um ein von Stable Diffusion erzeugtes Bild für die Ausgabe in der History vorzubereiten
@@ -768,7 +771,10 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
768
  show_progress=True,
769
  )
770
 
771
-
 
 
 
772
  reset_args = dict(
773
  fn=reset_textbox, inputs=[], outputs=[user_input, status_display]
774
  )
@@ -778,8 +784,8 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
778
  fn=add_text, inputs=[chatbot, history, user_input, attached_file], outputs=[chatbot, history, user_question, attached_file, image_display , user_input], show_progress=True
779
  )
780
 
781
- predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args)
782
- predict_event2 = submitBtn.click(**transfer_input_args, queue=False,).then(**predict_args)
783
  predict_event3 = upload.upload(file_anzeigen, [upload], [image_display, image_display, attached_file] ) #.then(**predict_args)
784
  emptyBtn.click(clear_all, [], [attached_file, image_display])
785
  image_display.select(file_loeschen, [], [attached_file, image_display])
 
176
 
177
  def reset_textbox():
178
  return gr.update(value=""),""
179
+
180
+ def reset_file():
181
+ return gr.Image(visible = False), None
182
 
183
  ##########################################
184
  #Hilfsfunktion, um ein von Stable Diffusion erzeugtes Bild für die Ausgabe in der History vorzubereiten
 
771
  show_progress=True,
772
  )
773
 
774
+ end_args = dict(
775
+ fn=reset_file, inputs=[], outputs=[image_display, attached_file]
776
+ )
777
+
778
  reset_args = dict(
779
  fn=reset_textbox, inputs=[], outputs=[user_input, status_display]
780
  )
 
784
  fn=add_text, inputs=[chatbot, history, user_input, attached_file], outputs=[chatbot, history, user_question, attached_file, image_display , user_input], show_progress=True
785
  )
786
 
787
+ predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args).then(**end_args)
788
+ predict_event2 = submitBtn.click(**transfer_input_args, queue=False,).then(**predict_args).then(**end_args)
789
  predict_event3 = upload.upload(file_anzeigen, [upload], [image_display, image_display, attached_file] ) #.then(**predict_args)
790
  emptyBtn.click(clear_all, [], [attached_file, image_display])
791
  image_display.select(file_loeschen, [], [attached_file, image_display])