chore: bump docling

This commit is contained in:
Alex committed 2026-08-12 09:05:00 +01:00
1 parent 0d7fd529ef
commit ca53a3ac4b
7 files changed
+214 -1

No files matched your search

+1
View File
@@ -95,6 +95,7 @@ class Settings(BaseSettings):
# Pages docling's threaded pipeline buffers in flight; the library
# default (100) drives worker RSS to ~3 GB on a mid-size PDF.
DOCLING_PIPELINE_QUEUE_MAX_SIZE: int = 2
DOCLING_COMPILE_TORCH_MODELS: bool = False
DOCLING_TABULAR_MAX_BYTES: int = 2_000_000
DOCLING_MARKUP_MAX_BYTES: int = 8_000_000
ATTACHMENT_TEXT_MAX_BYTES: int = 5_000_000
+3
View File
@@ -252,6 +252,9 @@ def _docling_structured(path: Path, *, ocr_enabled: bool, include_tables: bool,
else:
from docling.document_converter import DocumentConverter
from application.parser.file.docling_parser import _apply_inference_settings
_apply_inference_settings()
converter = DocumentConverter()
doc = converter.convert(str(path)).document
markdown = doc.export_to_markdown()
+25
View File
@@ -43,6 +43,29 @@ def _apply_pipeline_caps(pipeline_options) -> None:
setattr(pipeline_options, name, value)
def _apply_inference_settings() -> None:
"""Set docling's global torch.compile toggle from ``DOCLING_COMPILE_TORCH_MODELS``.
docling compiles its layout/table/OCR models with ``torch.compile`` by
default. For DocsGPT's one-shot, per-file parses that warmup is never
amortized, and it hard-fails wherever TorchInductor cannot build: it emits
invalid Metal on Apple Silicon, and its C++ path does not quote the ``-L``
library path, so any install directory containing a space fails to build.
Guarded so docling builds without the inference settings are unaffected.
"""
from application.core.settings import settings
try:
from docling.datamodel.settings import settings as docling_settings
except ImportError: # pragma: no cover - docling always present here
return
inference = getattr(docling_settings, "inference", None)
if inference is not None and hasattr(inference, "compile_torch_models"):
inference.compile_torch_models = settings.DOCLING_COMPILE_TORCH_MODELS
def _tabular_content_size(file: Path) -> int:
"""Effective content size of a tabular file, in bytes.
@@ -256,6 +279,8 @@ class DoclingParser(BaseParser):
)
from docling.datamodel.pipeline_options import PdfPipelineOptions
_apply_inference_settings()
pipeline_options = PdfPipelineOptions(
do_ocr=self.ocr_enabled,
do_table_structure=self.table_structure,
+1 -1
View File
@@ -12,7 +12,7 @@ cryptography==50.0.0
dataclasses-json==0.6.7
daytona==0.203.0
defusedxml==0.7.1
docling==2.84.0
docling==2.119.0
rapidocr==3.9.2
onnxruntime==1.28.0
docx2txt==0.9