Skip to content

Commit b72f7f8

Browse files
authored
feat: Expose new standard pipeline with threads and its parameters (#70)
use features of the new standard pipeline with threads Signed-off-by: Michele Dolfi <[email protected]>
1 parent 358704b commit b72f7f8

File tree

3 files changed

+1991
-1656
lines changed

3 files changed

+1991
-1656
lines changed

docling_jobkit/convert/manager.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ class DoclingConverterManagerConfig(BaseModel):
5050
max_num_pages: int = sys.maxsize
5151
max_file_size: int = sys.maxsize
5252

53+
# Threading pipeline
54+
queue_max_size: Optional[int] = None
55+
ocr_batch_size: Optional[int] = None
56+
layout_batch_size: Optional[int] = None
57+
table_batch_size: Optional[int] = None
58+
batch_polling_interval_seconds: Optional[float] = None
59+
5360

5461
# Custom serializer for PdfFormatOption
5562
# (model_dump_json does not work with some classes)
@@ -202,6 +209,17 @@ def _parse_standard_pdf_opts(
202209
request.picture_description_area_threshold
203210
)
204211

212+
# Forward the definition of the following attributes, if they are not none
213+
for attr in (
214+
"queue_max_size",
215+
"ocr_batch_size",
216+
"layout_batch_size",
217+
"table_batch_size",
218+
"batch_polling_interval_seconds",
219+
):
220+
if value := getattr(self.config, attr):
221+
setattr(pipeline_options, attr, value)
222+
205223
return pipeline_options
206224

207225
def _parse_backend(

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ classifiers = [
4141
]
4242
requires-python = ">=3.10"
4343
dependencies = [
44-
"docling~=2.56",
44+
"docling~=2.60",
4545
"pydantic~=2.10",
4646
"pydantic-settings~=2.4",
4747
"typer~=0.12",
@@ -55,7 +55,7 @@ dependencies = [
5555

5656
[project.optional-dependencies]
5757
vlm = [
58-
"docling[vlm]~=2.53",
58+
"docling[vlm]~=2.60",
5959
]
6060
# asr = [
6161
# "docling[asr]~=2.53",

0 commit comments

Comments
 (0)