RAG / src /loader.py
Rahbarnisa's picture
Upload 21 files
4321589 verified
raw
history blame contribute delete
348 Bytes
from langchain_community.document_loaders import PyPDFLoader
import os
def load_all_pdfs(folder_path="data"):
documents = []
for file in os.listdir(folder_path):
if file.endswith(".pdf"):
loader = PyPDFLoader(os.path.join(folder_path, file))
documents.extend(loader.load())
return documents