Update app.py
Browse files
app.py
CHANGED
@@ -428,7 +428,7 @@ with gr.Blocks(css=customCSS, theme=themeAlex) as demo:
|
|
428 |
submitBtn = gr.Button("Senden")
|
429 |
with gr.Column(min_width=70, scale=1):
|
430 |
cancelBtn = gr.Button("Stop")
|
431 |
-
with gr.Row():
|
432 |
image_display = gr.Image( visible=False)
|
433 |
upload = gr.UploadButton("📁", file_types=["pdf", "docx", "pptx", "xlsx"], scale = 10)
|
434 |
emptyBtn = gr.ClearButton([user_input, chatbot, history, attached_file, attached_file_history, image_display], value="🧹 Neue Session", scale=10)
|
@@ -497,6 +497,18 @@ with gr.Blocks(css=customCSS, theme=themeAlex) as demo:
|
|
497 |
anzahl_docs = gr.Slider(label="Anzahl Dokumente", value=3, minimum=1, maximum=10, step=1, interactive=True, info="wie viele Dokumententeile aus dem Vektorstore an den prompt gehängt werden", visible=False)
|
498 |
openai_key = gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1, visible = False)
|
499 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
500 |
|
501 |
gr.Markdown(description)
|
502 |
|
|
|
428 |
submitBtn = gr.Button("Senden")
|
429 |
with gr.Column(min_width=70, scale=1):
|
430 |
cancelBtn = gr.Button("Stop")
|
431 |
+
with gr.Row(visible = False):
|
432 |
image_display = gr.Image( visible=False)
|
433 |
upload = gr.UploadButton("📁", file_types=["pdf", "docx", "pptx", "xlsx"], scale = 10)
|
434 |
emptyBtn = gr.ClearButton([user_input, chatbot, history, attached_file, attached_file_history, image_display], value="🧹 Neue Session", scale=10)
|
|
|
497 |
anzahl_docs = gr.Slider(label="Anzahl Dokumente", value=3, minimum=1, maximum=10, step=1, interactive=True, info="wie viele Dokumententeile aus dem Vektorstore an den prompt gehängt werden", visible=False)
|
498 |
openai_key = gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1, visible = False)
|
499 |
|
500 |
+
with gr.Tab("Datei hochladen"):
|
501 |
+
upload_pdf_file = gr.File(label="PDF- oder Word-Datei hochladen")
|
502 |
+
output_text = gr.Textbox(label="Status")
|
503 |
+
#upload_button = gr.Button("Datei hochladen")
|
504 |
+
file_list = gr.HTML(elem_id="file_list", show_label=False)
|
505 |
+
|
506 |
+
#upload_button.click(fn=upload_pdf, inputs=upload_pdf_file, outputs=output_text)
|
507 |
+
# Automatisches Ausführen der Upload-Funktion, wenn eine Datei hochgeladen wird
|
508 |
+
upload_pdf_file.change(fn=upload_pdf, inputs=upload_pdf_file, outputs=output_text)
|
509 |
+
#gr.HTML(update=display_files, elem_id="file_list", show_label=False)
|
510 |
+
demo.load(display_files, outputs=file_list)
|
511 |
+
|
512 |
|
513 |
gr.Markdown(description)
|
514 |
|