Skip to content

Commit

Permalink
Initialize docling PDF parser on module level
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Auer <[email protected]>
  • Loading branch information
cau-git committed Sep 16, 2024
1 parent f1932fd commit 1b1af3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docling/backend/docling_parse_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

_log = logging.getLogger(__name__)

pdf_parser = pdf_parser()


class DoclingParsePageBackend(PdfPageBackend):
def __init__(
Expand Down Expand Up @@ -190,7 +192,7 @@ def __init__(self, path_or_stream: Union[BytesIO, Path], document_hash: str):
super().__init__(path_or_stream, document_hash)

self._pdoc = pdfium.PdfDocument(path_or_stream)
self.parser = pdf_parser()
self.parser = pdf_parser

success = False
if isinstance(path_or_stream, BytesIO):
Expand Down

0 comments on commit 1b1af3d

Please sign in to comment.