danicafisher commited on
Commit
3dd7eaa
·
verified ·
1 Parent(s): 4383677

Update helper_functions.py

Browse files
Files changed (1) hide show
  1. 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.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
 
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