Update app.py
Browse files
app.py
CHANGED
|
@@ -177,8 +177,6 @@ def cancel_outputing():
|
|
| 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
|
|
@@ -479,11 +477,11 @@ def generate_auswahl(prompt, file, chatbot, history, rag_option, model_option, o
|
|
| 479 |
for character in result:
|
| 480 |
chatbot[-1][1] += character
|
| 481 |
time.sleep(0.03)
|
| 482 |
-
yield chatbot, history, "Generating"
|
| 483 |
if shared_state.interrupted:
|
| 484 |
shared_state.recover()
|
| 485 |
try:
|
| 486 |
-
yield chatbot, history, "Stop: Success"
|
| 487 |
except:
|
| 488 |
pass
|
| 489 |
|
|
@@ -767,13 +765,9 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
| 767 |
max_context_length_tokens,
|
| 768 |
repetition_penalty
|
| 769 |
],
|
| 770 |
-
outputs=[chatbot, history, status_display], #[chatbot, history, status_display]
|
| 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]
|
|
@@ -784,8 +778,8 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
| 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)
|
| 788 |
-
predict_event2 = submitBtn.click(**transfer_input_args, queue=False,).then(**predict_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])
|
|
|
|
| 177 |
def reset_textbox():
|
| 178 |
return gr.update(value=""),""
|
| 179 |
|
|
|
|
|
|
|
| 180 |
|
| 181 |
##########################################
|
| 182 |
#Hilfsfunktion, um ein von Stable Diffusion erzeugtes Bild für die Ausgabe in der History vorzubereiten
|
|
|
|
| 477 |
for character in result:
|
| 478 |
chatbot[-1][1] += character
|
| 479 |
time.sleep(0.03)
|
| 480 |
+
yield chatbot, history, None, "Generating"
|
| 481 |
if shared_state.interrupted:
|
| 482 |
shared_state.recover()
|
| 483 |
try:
|
| 484 |
+
yield chatbot, history, None, "Stop: Success"
|
| 485 |
except:
|
| 486 |
pass
|
| 487 |
|
|
|
|
| 765 |
max_context_length_tokens,
|
| 766 |
repetition_penalty
|
| 767 |
],
|
| 768 |
+
outputs=[chatbot, history, attached_file, status_display], #[chatbot, history, status_display]
|
| 769 |
show_progress=True,
|
| 770 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 771 |
|
| 772 |
reset_args = dict(
|
| 773 |
fn=reset_textbox, inputs=[], outputs=[user_input, status_display]
|
|
|
|
| 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])
|