Spaces:
Sleeping
Sleeping
Tushar Malik
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -510,17 +510,14 @@ def chatbot_interface(user_query, response_style, selected_retrieval_methods, se
|
|
| 510 |
|
| 511 |
|
| 512 |
if pdf_file is not None:
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
# Create vector DB and Annoy index
|
| 520 |
create_vector_db_and_annoy_index(pdf_path, vector_db_path, annoy_index_path)
|
| 521 |
store_embeddings_in_vector_db(pdf_path, 'vector_db.pkl', 'vector_index.ann', chunk_size, overlap)
|
| 522 |
-
else:
|
| 523 |
-
return "Please upload a PDF file."
|
| 524 |
# if pdf_file is not None:
|
| 525 |
# pdf_path = pdf_file.name # Get the path of the uploaded file
|
| 526 |
# create_vector_db_and_annoy_index(pdf_path, 'vector_db.pkl', 'vector_index.ann')
|
|
|
|
| 510 |
|
| 511 |
|
| 512 |
if pdf_file is not None:
|
| 513 |
+
pdf_path = pdf_file.name # Get the file path
|
| 514 |
+
# Now you can process the file path as needed
|
| 515 |
+
return f"File path: {pdf_path}\nUser Query: {user_query}\nResponse Style: {response_style}\nRetrieval Methods: {retrieval_methods}\nReranking Methods: {reranking_methods}\nChunk Size: {chunk_size}\nOverlap: {overlap}"
|
| 516 |
+
else:
|
| 517 |
+
return "No file uploaded."
|
|
|
|
| 518 |
# Create vector DB and Annoy index
|
| 519 |
create_vector_db_and_annoy_index(pdf_path, vector_db_path, annoy_index_path)
|
| 520 |
store_embeddings_in_vector_db(pdf_path, 'vector_db.pkl', 'vector_index.ann', chunk_size, overlap)
|
|
|
|
|
|
|
| 521 |
# if pdf_file is not None:
|
| 522 |
# pdf_path = pdf_file.name # Get the path of the uploaded file
|
| 523 |
# create_vector_db_and_annoy_index(pdf_path, 'vector_db.pkl', 'vector_index.ann')
|