Spaces:
Build error
Build error
Update src/upload_file.py
Browse files- src/upload_file.py +3 -3
src/upload_file.py
CHANGED
|
@@ -14,7 +14,7 @@ class UploadFile:
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
@staticmethod
|
| 17 |
-
def process_uploaded_files(files_dir: List, chatbot: List, rag_with_dropdown: str) -> Tuple:
|
| 18 |
"""
|
| 19 |
Prepares and saves a VectorDB from uploaded files.
|
| 20 |
|
|
@@ -25,7 +25,7 @@ class UploadFile:
|
|
| 25 |
Returns:
|
| 26 |
Tuple: A tuple containing an empty string and the updated chatbot instance.
|
| 27 |
"""
|
| 28 |
-
if rag_with_dropdown == "Upload
|
| 29 |
prepare_vectordb_instance = PrepareVectorDB(data_directory=files_dir,
|
| 30 |
persist_directory=APP_CONFIG.custom_persist_directory,
|
| 31 |
embedding_model_engine=APP_CONFIG.embedding_model_engine,
|
|
@@ -36,5 +36,5 @@ class UploadFile:
|
|
| 36 |
(" ", "Uploaded files are ready for querying."))
|
| 37 |
else:
|
| 38 |
chatbot.append(
|
| 39 |
-
(" ", "If you want to upload your own PDF, please select '
|
| 40 |
return "", chatbot
|
|
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
@staticmethod
|
| 17 |
+
def process_uploaded_files(files_dir: List, chatbot: List, llm = rag_with_dropdown: str) -> Tuple:
|
| 18 |
"""
|
| 19 |
Prepares and saves a VectorDB from uploaded files.
|
| 20 |
|
|
|
|
| 25 |
Returns:
|
| 26 |
Tuple: A tuple containing an empty string and the updated chatbot instance.
|
| 27 |
"""
|
| 28 |
+
if rag_with_dropdown == "Upload new data":
|
| 29 |
prepare_vectordb_instance = PrepareVectorDB(data_directory=files_dir,
|
| 30 |
persist_directory=APP_CONFIG.custom_persist_directory,
|
| 31 |
embedding_model_engine=APP_CONFIG.embedding_model_engine,
|
|
|
|
| 36 |
(" ", "Uploaded files are ready for querying."))
|
| 37 |
else:
|
| 38 |
chatbot.append(
|
| 39 |
+
(" ", "If you want to upload your own PDF, please select 'Upload new data' from the dropdown."))
|
| 40 |
return "", chatbot
|