diff --git a/docling/cli/main.py b/docling/cli/main.py index 92b0f741..6686da9a 100644 --- a/docling/cli/main.py +++ b/docling/cli/main.py @@ -234,7 +234,7 @@ def convert( Optional[Path], typer.Option(..., help="If provided, the location of the model artifacts."), ] = None, - allow_remote_services: Annotated[ + enable_remote_services: Annotated[ bool, typer.Option( ..., help="Must be enabled when using models connecting to remote services." @@ -386,7 +386,7 @@ def convert( accelerator_options = AcceleratorOptions(num_threads=num_threads, device=device) pipeline_options = PdfPipelineOptions( - allow_remote_services=allow_remote_services, + enable_remote_services=enable_remote_services, accelerator_options=accelerator_options, do_ocr=ocr, ocr_options=ocr_options, diff --git a/docling/datamodel/pipeline_options.py b/docling/datamodel/pipeline_options.py index ef533883..16fb1456 100644 --- a/docling/datamodel/pipeline_options.py +++ b/docling/datamodel/pipeline_options.py @@ -257,7 +257,7 @@ class PipelineOptions(BaseModel): ) document_timeout: Optional[float] = None accelerator_options: AcceleratorOptions = AcceleratorOptions() - allow_remote_services: bool = False + enable_remote_services: bool = False class PdfPipelineOptions(PipelineOptions): diff --git a/docling/models/picture_description_api_model.py b/docling/models/picture_description_api_model.py index ff8d95a1..c64f1bfe 100644 --- a/docling/models/picture_description_api_model.py +++ b/docling/models/picture_description_api_model.py @@ -49,17 +49,17 @@ class PictureDescriptionApiModel(PictureDescriptionBaseModel): def __init__( self, enabled: bool, - allow_remote_services: bool, + enable_remote_services: bool, options: PictureDescriptionApiOptions, ): super().__init__(enabled=enabled, options=options) self.options: PictureDescriptionApiOptions if self.enabled: - if not allow_remote_services: + if not enable_remote_services: raise OperationNotAllowed( "Connections to remote services is only allowed when set explicitly. " - "pipeline_options.allow_remote_services=True." + "pipeline_options.enable_remote_services=True." ) def _annotate_images(self, images: Iterable[Image.Image]) -> Iterable[str]: diff --git a/docling/pipeline/standard_pdf_pipeline.py b/docling/pipeline/standard_pdf_pipeline.py index f1cb6987..3b8bee01 100644 --- a/docling/pipeline/standard_pdf_pipeline.py +++ b/docling/pipeline/standard_pdf_pipeline.py @@ -201,7 +201,7 @@ class StandardPdfPipeline(PaginatedPipeline): ): return PictureDescriptionApiModel( enabled=self.pipeline_options.do_picture_description, - allow_remote_services=self.pipeline_options.allow_remote_services, + enable_remote_services=self.pipeline_options.enable_remote_services, options=self.pipeline_options.picture_description_options, ) elif isinstance( diff --git a/docs/examples/pictures_description_api.py b/docs/examples/pictures_description_api.py index f8bf5ad4..05689c50 100644 --- a/docs/examples/pictures_description_api.py +++ b/docs/examples/pictures_description_api.py @@ -21,7 +21,7 @@ def main(): # $ vllm serve "HuggingFaceTB/SmolVLM-256M-Instruct" pipeline_options = PdfPipelineOptions( - allow_remote_services=True # <-- this is required! + enable_remote_services=True # <-- this is required! ) pipeline_options.do_picture_description = True pipeline_options.picture_description_options = PictureDescriptionApiOptions( diff --git a/docs/usage.md b/docs/usage.md index ad8c57f3..4b5e4ba1 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -83,7 +83,7 @@ from docling.datamodel.base_models import InputFormat from docling.datamodel.pipeline_options import PdfPipelineOptions from docling.document_converter import DocumentConverter, PdfFormatOption -pipeline_options = PdfPipelineOptions(allow_remote_services=True) +pipeline_options = PdfPipelineOptions(enable_remote_services=True) doc_converter = DocumentConverter( format_options={ InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options) @@ -91,13 +91,13 @@ doc_converter = DocumentConverter( ) ``` -When the value `allow_remote_services=True` is not set, the system will raise an exception `OperationNotAllowed()`. +When the value `enable_remote_services=True` is not set, the system will raise an exception `OperationNotAllowed()`. _Note: This option is only related to the system sending user data to remote services. Control of pulling data (e.g. model weights) follows the logic described in [Model prefetching and offline usage](#model-prefetching-and-offline-usage)._ ##### List of remote model services -The options in this list require the explicit `allow_remote_services=True` when processing the documents. +The options in this list require the explicit `enable_remote_services=True` when processing the documents. - `PictureDescriptionApiOptions`: Using vision models via API calls.