Skip to content

Commit d6d7041

Browse files
moved keep_deprecated_annotations to _keep_deprecated_annotations
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
1 parent fc6032e commit d6d7041

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

docling/datamodel/picture_classification_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DocumentPictureClassifierOptions(
2828
# TODO: default should become False in a future release, and this field
2929
# may be removed entirely once docling-core drops the deprecated
3030
# `annotations` attribute from DoclingDocument items.
31-
keep_deprecated_annotations: bool = True
31+
_keep_deprecated_annotations: bool = True
3232

3333
model_spec: ImageClassificationModelSpec = Field(
3434
default_factory=lambda: stage_model_specs.IMAGE_CLASSIFICATION_DOCUMENT_FIGURE.model_spec.model_copy(

docling/datamodel/pipeline_options.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ class BaseOptions(BaseModel):
7272

7373
kind: ClassVar[str]
7474

75-
# TODO: default should become False in a future release, and this field
76-
# may be removed entirely once docling-core drops the deprecated
77-
# `annotations` attribute from DoclingDocument items.
78-
keep_deprecated_annotations: bool = True
79-
8075

8176
class TableFormerMode(str, Enum):
8277
"""Operating modes for TableFormer table structure extraction model.
@@ -469,6 +464,11 @@ class OcrMacOptions(OcrOptions):
469464
class PictureDescriptionBaseOptions(BaseOptions):
470465
"""Base configuration for picture description models."""
471466

467+
# TODO: default should become False in a future release, and this field
468+
# may be removed entirely once docling-core drops the deprecated
469+
# `annotations` attribute from DoclingDocument items.
470+
_keep_deprecated_annotations: bool = True
471+
472472
batch_size: Annotated[
473473
int,
474474
Field(

docling/models/picture_description_base_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __call__(
8989

9090
for item, output in zip(elements, outputs):
9191
# FIXME: annotations is deprecated, remove once all consumers use meta.classification
92-
if self.options.keep_deprecated_annotations:
92+
if self.options._keep_deprecated_annotations:
9393
item.annotations.append(
9494
PictureDescriptionData(text=output, provenance=self.provenance)
9595
)

docling/models/stages/picture_classifier/document_picture_classifier.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def __call__(
181181
]
182182

183183
# FIXME: annotations is deprecated, remove once all consumers use meta.classification
184-
if self.options.keep_deprecated_annotations:
184+
if self.options._keep_deprecated_annotations:
185185
item.annotations.append(
186186
PictureClassificationData(
187187
provenance="DocumentPictureClassifier",

docling/pipeline/base_pipeline.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,7 @@ def __init__(self, pipeline_options: ConvertPipelineOptions):
167167
DocumentPictureClassifier(
168168
enabled=pipeline_options.do_picture_classification,
169169
artifacts_path=self.artifacts_path,
170-
options=pipeline_options.picture_classification_options.model_copy(
171-
update={
172-
"keep_deprecated_annotations": pipeline_options.keep_deprecated_annotations
173-
}
174-
),
170+
options=pipeline_options.picture_classification_options,
175171
accelerator_options=pipeline_options.accelerator_options,
176172
enable_remote_services=pipeline_options.enable_remote_services,
177173
),

0 commit comments

Comments
 (0)