diff --git a/autollm/__init__.py b/autollm/__init__.py index 916f6cee..e6fd8a9f 100644 --- a/autollm/__init__.py +++ b/autollm/__init__.py @@ -4,7 +4,7 @@ and vector databases, along with various utility functions. """ -__version__ = '0.1.1' +__version__ = '0.1.2' __author__ = 'safevideo' __license__ = 'AGPL-3.0' diff --git a/autollm/utils/pdf_reader.py b/autollm/utils/pdf_reader.py index 6238e3ff..b8c84b53 100644 --- a/autollm/utils/pdf_reader.py +++ b/autollm/utils/pdf_reader.py @@ -1,6 +1,5 @@ from typing import List -from langchain.document_loaders import PDFMinerLoader from llama_index.readers.base import BaseReader from llama_index.schema import Document @@ -16,6 +15,8 @@ def __init__(self, extract_images: bool = False) -> None: def load_data(self, file_path: str, extra_info: dict = None) -> List[Document]: """Load data from a PDF file using langchain's PDFMinerLoader.""" + from langchain.document_loaders import PDFMinerLoader + # Convert the PosixPath object to a string before passing it to PDFMinerLoader loader = PDFMinerLoader(str(file_path), extract_images=self.extract_images)