Spaces:
Sleeping
Sleeping
Download loader.py from Aaravkumar/Documind-V2: direct link, hf CLI and curl.
- Browser
- Download file 400 Bytes
-
https://huggingface.co/spaces/Aaravkumar/Documind-V2/resolve/main/loader.py
- Command line
-
hf download hf://spaces/Aaravkumar/Documind-V2/loader.py
-
curl -L -o loader.py https://huggingface.co/spaces/Aaravkumar/Documind-V2/resolve/main/loader.py
400 Bytes
| from haystack.components.converters import PyPDFToDocument | |
| from pathlib import Path | |
| class Loader: | |
| def __init__(self,file_path) -> None: | |
| self.filepath = file_path | |
| def load(self): | |
| converter = PyPDFToDocument() | |
| output = converter.run(sources=[Path(self.filepath)]) | |
| documents = output["documents"] | |
| #print(documents) | |
| return documents |