Rahbarnisa's picture
Upload 22 files
808abfd 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