Spaces:
Runtime error
Runtime error
Download src/loader.py from Rahbarnisa/RAG_Pharm_Company_Support_System: direct link, hf CLI and curl.
- Browser
- Download file 348 Bytes
-
https://huggingface.co/spaces/Rahbarnisa/RAG_Pharm_Company_Support_System/resolve/main/src/loader.py
- Command line
-
hf download hf://spaces/Rahbarnisa/RAG_Pharm_Company_Support_System/src/loader.py
-
curl -L -o loader.py https://huggingface.co/spaces/Rahbarnisa/RAG_Pharm_Company_Support_System/resolve/main/src/loader.py
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 |