bug fix upload data
Browse files- src/vector_index.py +3 -1
src/vector_index.py
CHANGED
@@ -11,11 +11,13 @@ def create_vector_store_index(file_path):
|
|
11 |
file_path_split = file_path.split(".")
|
12 |
file_type = file_path_split[-1].rstrip('/')
|
13 |
|
14 |
-
if file_type == '
|
15 |
loader = Docx2txtLoader(file_path)
|
16 |
|
17 |
elif file_type == 'pdf':
|
18 |
loader = PyPDFLoader(file_path)
|
|
|
|
|
19 |
|
20 |
pages = loader.load()
|
21 |
|
|
|
11 |
file_path_split = file_path.split(".")
|
12 |
file_type = file_path_split[-1].rstrip('/')
|
13 |
|
14 |
+
if file_type == 'docx':
|
15 |
loader = Docx2txtLoader(file_path)
|
16 |
|
17 |
elif file_type == 'pdf':
|
18 |
loader = PyPDFLoader(file_path)
|
19 |
+
else:
|
20 |
+
return "Wrong file type"
|
21 |
|
22 |
pages = loader.load()
|
23 |
|