Update app.py
Browse files
app.py
CHANGED
|
@@ -133,6 +133,11 @@ os.environ["HUGGINGFACEHUB_API_TOKEN"] = HUGGINGFACEHUB_API_TOKEN
|
|
| 133 |
#Funktionen zur Verarbeitung
|
| 134 |
################################################
|
| 135 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
##############################################
|
| 137 |
#History - die Frage oder das File eintragen...
|
| 138 |
def add_text(chatbot, history, prompt, file):
|
|
@@ -567,9 +572,9 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
| 567 |
with gr.Column(min_width=70, scale=1):
|
| 568 |
cancelBtn = gr.Button("Stop")
|
| 569 |
with gr.Row():
|
| 570 |
-
file_display = gr.File( label=None, interactive=False, height=
|
| 571 |
-
emptyBtn = gr.ClearButton( [user_input, chatbot, history, file_display], value="🧹 Neue Session", scale=3)
|
| 572 |
upload = gr.UploadButton("📁", file_types=["image", "video", "audio"], scale=3)
|
|
|
|
| 573 |
|
| 574 |
with gr.Column():
|
| 575 |
with gr.Column(min_width=50, scale=1):
|
|
|
|
| 133 |
#Funktionen zur Verarbeitung
|
| 134 |
################################################
|
| 135 |
|
| 136 |
+
##############################################
|
| 137 |
+
#wenn löschen Button geklickt
|
| 138 |
+
def clear_all(user_input, chatbot, history, file_display):
|
| 139 |
+
return gr.File(visible=False)
|
| 140 |
+
|
| 141 |
##############################################
|
| 142 |
#History - die Frage oder das File eintragen...
|
| 143 |
def add_text(chatbot, history, prompt, file):
|
|
|
|
| 572 |
with gr.Column(min_width=70, scale=1):
|
| 573 |
cancelBtn = gr.Button("Stop")
|
| 574 |
with gr.Row():
|
| 575 |
+
file_display = gr.File( label=None, interactive=False, height=20, min_width=20, visible=False, scale=2)
|
|
|
|
| 576 |
upload = gr.UploadButton("📁", file_types=["image", "video", "audio"], scale=3)
|
| 577 |
+
emptyBtn = gr.ClearButton( clear_all, [user_input, chatbot, history, file_display], [file_display], value="🧹 Neue Session", scale=3)
|
| 578 |
|
| 579 |
with gr.Column():
|
| 580 |
with gr.Column(min_width=50, scale=1):
|