danicafisher commited on
Commit
4383677
·
verified ·
1 Parent(s): 5d6be6a

Update helper_functions.py

Browse files
Files changed (1) hide show
  1. helper_functions.py +3 -3
helper_functions.py CHANGED
@@ -3,12 +3,12 @@ from langchain_community.vectorstores import Qdrant
3
 
4
  def process_file(file):
5
  documents = []
6
- if file.name.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
 
3
 
4
  def process_file(file):
5
  documents = []
6
+ if file.path.endswith(".pdf"):
7
+ loader = PyMuPDFLoader(file.path)
8
  docs = loader.load()
9
  documents.extend(docs)
10
  else:
11
+ loader = TextLoader(file.path)
12
  docs = loader.load()
13
  documents.extend(docs)
14
  return documents