Update app.py
Browse files
app.py
CHANGED
@@ -145,7 +145,7 @@ def add_file(history, file, prompt):
|
|
145 |
return history, prompt, ""
|
146 |
|
147 |
def file_anzeigen(file):
|
148 |
-
return file.name
|
149 |
|
150 |
def create_picture_backup(history, prompt):
|
151 |
client = OpenAI()
|
@@ -486,7 +486,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
486 |
with gr.Row():
|
487 |
emptyBtn = gr.ClearButton( [user_input, chatbot], value="🧹 Neue Session")
|
488 |
upload = gr.UploadButton("📁", file_types=["image", "video", "audio"])
|
489 |
-
file_display = gr.File(label=None, interactive=False, height=20)
|
490 |
|
491 |
with gr.Column():
|
492 |
with gr.Column(min_width=50, scale=1):
|
@@ -566,7 +566,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
566 |
|
567 |
predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args)
|
568 |
predict_event2 = submitBtn.click(**transfer_input_args, queue=False,).then(**predict_args)
|
569 |
-
predict_event3 = upload.upload(file_anzeigen, [upload], [file_display] ) #.then(**predict_args)
|
570 |
|
571 |
cancelBtn.click(
|
572 |
cancels=[predict_event1,predict_event2, predict_event3 ]
|
|
|
145 |
return history, prompt, ""
|
146 |
|
147 |
def file_anzeigen(file):
|
148 |
+
return gr.File(visible=True), file.name
|
149 |
|
150 |
def create_picture_backup(history, prompt):
|
151 |
client = OpenAI()
|
|
|
486 |
with gr.Row():
|
487 |
emptyBtn = gr.ClearButton( [user_input, chatbot], value="🧹 Neue Session")
|
488 |
upload = gr.UploadButton("📁", file_types=["image", "video", "audio"])
|
489 |
+
file_display = gr.File( label=None, interactive=False, height=20, min_width=20, visible=False, scale=2)
|
490 |
|
491 |
with gr.Column():
|
492 |
with gr.Column(min_width=50, scale=1):
|
|
|
566 |
|
567 |
predict_event1 = user_input.submit(**transfer_input_args, queue=False,).then(**predict_args)
|
568 |
predict_event2 = submitBtn.click(**transfer_input_args, queue=False,).then(**predict_args)
|
569 |
+
predict_event3 = upload.upload(file_anzeigen, [upload], [file_display, file_display] ) #.then(**predict_args)
|
570 |
|
571 |
cancelBtn.click(
|
572 |
cancels=[predict_event1,predict_event2, predict_event3 ]
|