Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -143,8 +143,10 @@ def update_vectors(files, parser):
|
|
143 |
# Save the updated list of documents
|
144 |
save_documents(uploaded_documents)
|
145 |
|
|
|
146 |
return f"Vector store updated successfully. Processed {total_chunks} chunks from {len(files)} files using {parser}.", display_documents()
|
147 |
|
|
|
148 |
def delete_documents(selected_docs):
|
149 |
global uploaded_documents
|
150 |
|
@@ -711,12 +713,12 @@ with demo:
|
|
711 |
|
712 |
update_output = gr.Textbox(label="Update Status")
|
713 |
delete_button = gr.Button("Delete Selected Documents")
|
714 |
-
|
715 |
-
|
|
|
716 |
update_button.click(update_vectors,
|
717 |
inputs=[file_input, parser_dropdown],
|
718 |
-
outputs=[
|
719 |
-
|
720 |
# Add the refresh button functionality
|
721 |
refresh_button.click(refresh_documents,
|
722 |
inputs=[],
|
|
|
143 |
# Save the updated list of documents
|
144 |
save_documents(uploaded_documents)
|
145 |
|
146 |
+
# Return a tuple with the status message and the updated document list
|
147 |
return f"Vector store updated successfully. Processed {total_chunks} chunks from {len(files)} files using {parser}.", display_documents()
|
148 |
|
149 |
+
|
150 |
def delete_documents(selected_docs):
|
151 |
global uploaded_documents
|
152 |
|
|
|
713 |
|
714 |
update_output = gr.Textbox(label="Update Status")
|
715 |
delete_button = gr.Button("Delete Selected Documents")
|
716 |
+
|
717 |
+
|
718 |
+
# In your Gradio interface setup
|
719 |
update_button.click(update_vectors,
|
720 |
inputs=[file_input, parser_dropdown],
|
721 |
+
outputs=[gr.Textbox(label="Update Status"), document_selector])
|
|
|
722 |
# Add the refresh button functionality
|
723 |
refresh_button.click(refresh_documents,
|
724 |
inputs=[],
|