File size: 400 Bytes
23cbf60
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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