Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1602,7 +1602,7 @@ def process_pdf(pdf_file):
|
|
1602 |
# Add the record to the global list
|
1603 |
uploaded_documents.append(document_record)
|
1604 |
|
1605 |
-
return f"Uploaded {len(chunks)} chunks to the vector database."
|
1606 |
|
1607 |
|
1608 |
|
@@ -1717,7 +1717,7 @@ with gr.Blocks(theme='gradio/soft') as demo:
|
|
1717 |
process_button = gr.Button("Process PDF and Upload")
|
1718 |
|
1719 |
# Dataframe to display uploaded document records
|
1720 |
-
document_table = gr.Dataframe(headers=["Document Name", "
|
1721 |
|
1722 |
|
1723 |
# Output textbox for results
|
@@ -1725,7 +1725,7 @@ with gr.Blocks(theme='gradio/soft') as demo:
|
|
1725 |
|
1726 |
# Define button click action
|
1727 |
# process_button.click(fn=process_pdf, inputs=file_input, outputs=output_textbox)
|
1728 |
-
process_button.click(fn=process_pdf, inputs=[file_input, gr.State(
|
1729 |
|
1730 |
|
1731 |
|
|
|
1602 |
# Add the record to the global list
|
1603 |
uploaded_documents.append(document_record)
|
1604 |
|
1605 |
+
return uploaded_documents, f"Uploaded {len(chunks)} chunks to the vector database."
|
1606 |
|
1607 |
|
1608 |
|
|
|
1717 |
process_button = gr.Button("Process PDF and Upload")
|
1718 |
|
1719 |
# Dataframe to display uploaded document records
|
1720 |
+
document_table = gr.Dataframe(headers=["Document Name", "Uplo Time", "Chunks", "Pinecone Index"], adinteractive=False)
|
1721 |
|
1722 |
|
1723 |
# Output textbox for results
|
|
|
1725 |
|
1726 |
# Define button click action
|
1727 |
# process_button.click(fn=process_pdf, inputs=file_input, outputs=output_textbox)
|
1728 |
+
process_button.click(fn=process_pdf, inputs=[file_input, gr.State([])], outputs=[document_table, output_textbox])
|
1729 |
|
1730 |
|
1731 |
|