Update app.py
Browse files
app.py
CHANGED
|
@@ -425,7 +425,6 @@ def show_success():
|
|
| 425 |
return gr.Info( "System erfolgreich aktualisiert!")
|
| 426 |
|
| 427 |
def hide_status():
|
| 428 |
-
time.sleep(3)
|
| 429 |
return gr.HTML(value="", label="Status", visible=False) #gr.Textbox( visible = False)
|
| 430 |
|
| 431 |
def show_status():
|
|
@@ -594,12 +593,13 @@ with gr.Blocks(css=customCSS, theme=themeAlex) as demo:
|
|
| 594 |
openai_key = gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1, visible = False)
|
| 595 |
|
| 596 |
|
| 597 |
-
with gr.Tab("Datei hochladen"):
|
| 598 |
upload_pdf_files = gr.Files(label="PDF- oder Word-Dateien in Zwischenablage", file_count="multiple")
|
| 599 |
output_text = gr.HTML(value="", label="Status") #gr.Textbox(label="Status", visible = False)
|
| 600 |
message = gr.Markdown(visible=False, elem_id="popup_message")
|
| 601 |
renew_button = gr.Button("Dateien hochladen und System aktualisieren", elem_id="renew_button")
|
| 602 |
file_list = gr.HTML(elem_id="file_list", show_label=False)
|
|
|
|
| 603 |
|
| 604 |
gr.Markdown(description)
|
| 605 |
|
|
@@ -662,7 +662,8 @@ with gr.Blocks(css=customCSS, theme=themeAlex) as demo:
|
|
| 662 |
renew_button.click(fn=upload_pdf, inputs=upload_pdf_files, outputs=[output_text, file_list]).then(
|
| 663 |
fn=update_vectorstore, inputs=None, outputs=output_text).then(
|
| 664 |
fn=reset_file_input, inputs=None, outputs=upload_pdf_files).then(fn=show_text_status, inputs=None, outputs=output_text) #.then(fn=hide_status, inputs=None, outputs=output_text, show_progress="hidden")
|
| 665 |
-
|
|
|
|
| 666 |
demo.load(display_files, outputs=file_list)
|
| 667 |
|
| 668 |
demo.title = "KKG-Suche"
|
|
|
|
| 425 |
return gr.Info( "System erfolgreich aktualisiert!")
|
| 426 |
|
| 427 |
def hide_status():
|
|
|
|
| 428 |
return gr.HTML(value="", label="Status", visible=False) #gr.Textbox( visible = False)
|
| 429 |
|
| 430 |
def show_status():
|
|
|
|
| 593 |
openai_key = gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1, visible = False)
|
| 594 |
|
| 595 |
|
| 596 |
+
with gr.Tab("Datei hochladen") as tab2:
|
| 597 |
upload_pdf_files = gr.Files(label="PDF- oder Word-Dateien in Zwischenablage", file_count="multiple")
|
| 598 |
output_text = gr.HTML(value="", label="Status") #gr.Textbox(label="Status", visible = False)
|
| 599 |
message = gr.Markdown(visible=False, elem_id="popup_message")
|
| 600 |
renew_button = gr.Button("Dateien hochladen und System aktualisieren", elem_id="renew_button")
|
| 601 |
file_list = gr.HTML(elem_id="file_list", show_label=False)
|
| 602 |
+
|
| 603 |
|
| 604 |
gr.Markdown(description)
|
| 605 |
|
|
|
|
| 662 |
renew_button.click(fn=upload_pdf, inputs=upload_pdf_files, outputs=[output_text, file_list]).then(
|
| 663 |
fn=update_vectorstore, inputs=None, outputs=output_text).then(
|
| 664 |
fn=reset_file_input, inputs=None, outputs=upload_pdf_files).then(fn=show_text_status, inputs=None, outputs=output_text) #.then(fn=hide_status, inputs=None, outputs=output_text, show_progress="hidden")
|
| 665 |
+
# Hide on refresh or tab switch
|
| 666 |
+
tab2.load(fn=hide_status, inputs=[], outputs=output_text)
|
| 667 |
demo.load(display_files, outputs=file_list)
|
| 668 |
|
| 669 |
demo.title = "KKG-Suche"
|