Spaces:
Paused
Paused
Update helper_functions.py
Browse files- helper_functions.py +2 -2
helper_functions.py
CHANGED
@@ -4,11 +4,11 @@ from langchain_community.vectorstores import Qdrant
|
|
4 |
def process_file(file):
|
5 |
documents = []
|
6 |
if file.path.endswith(".pdf"):
|
7 |
-
loader = PyMuPDFLoader(file.
|
8 |
docs = loader.load()
|
9 |
documents.extend(docs)
|
10 |
else:
|
11 |
-
loader = TextLoader(file.
|
12 |
docs = loader.load()
|
13 |
documents.extend(docs)
|
14 |
return documents
|
|
|
4 |
def process_file(file):
|
5 |
documents = []
|
6 |
if file.path.endswith(".pdf"):
|
7 |
+
loader = PyMuPDFLoader(file.name)
|
8 |
docs = loader.load()
|
9 |
documents.extend(docs)
|
10 |
else:
|
11 |
+
loader = TextLoader(file.name)
|
12 |
docs = loader.load()
|
13 |
documents.extend(docs)
|
14 |
return documents
|