Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,11 +65,11 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
65 |
return response['answer']
|
66 |
|
67 |
def upload_file(filepath):
|
68 |
-
|
69 |
-
|
70 |
|
71 |
# Update documents in the vector store
|
72 |
-
|
73 |
|
74 |
return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download {Path(filepath).name}", value=filepath, visible=True), f"{len(tables)} tables extracted."]
|
75 |
|
|
|
65 |
return response['answer']
|
66 |
|
67 |
def upload_file(filepath):
|
68 |
+
text = extract_text_from_pdf(filepath)
|
69 |
+
tables = extract_tables_from_pdf(filepath)
|
70 |
|
71 |
# Update documents in the vector store
|
72 |
+
update_documents(text)
|
73 |
|
74 |
return [gr.UploadButton(visible=False), gr.DownloadButton(label=f"Download {Path(filepath).name}", value=filepath, visible=True), f"{len(tables)} tables extracted."]
|
75 |
|