diff --git a/docling/cli/models_download.py b/docling/cli/models_download.py index cd8dff5a..3250d36d 100644 --- a/docling/cli/models_download.py +++ b/docling/cli/models_download.py @@ -24,7 +24,8 @@ err_console = Console(stderr=True) app = typer.Typer( - name="Docling model helper", + name="Docling models helper", + no_args_is_help=True, add_completion=False, pretty_exceptions_enable=False, ) @@ -149,9 +150,9 @@ def download( ) -@app.command(hidden=True) -def other(): - raise NotImplementedError() +# @app.command(hidden=True) +# def other(): +# raise NotImplementedError() click_app = typer.main.get_command(app) diff --git a/docling/cli/tools.py b/docling/cli/tools.py new file mode 100644 index 00000000..524fd632 --- /dev/null +++ b/docling/cli/tools.py @@ -0,0 +1,17 @@ +import typer + +from docling.cli.models_download import app as models_app + +app = typer.Typer( + name="Docling helpers", + no_args_is_help=True, + add_completion=False, + pretty_exceptions_enable=False, +) + +app.add_typer(models_app, name="models") + +click_app = typer.main.get_command(app) + +if __name__ == "__main__": + app() diff --git a/docs/examples/offline_convert.py b/docs/examples/offline_convert.py index 06e8ee84..7d40e077 100644 --- a/docs/examples/offline_convert.py +++ b/docs/examples/offline_convert.py @@ -4,7 +4,7 @@ from docling.datamodel.base_models import InputFormat from docling.datamodel.pipeline_options import EasyOcrOptions, PdfPipelineOptions from docling.document_converter import DocumentConverter, PdfFormatOption -# The location of the local artifacts, e.g. from the `docling-models download` command +# The location of the local artifacts, e.g. from the `docling-tools models download` command artifacts_path = Path("PATH TO MODELS") # <-- fill me pipeline_options = PdfPipelineOptions(artifacts_path=artifacts_path) pipeline_options.ocr_options = EasyOcrOptions( diff --git a/docs/usage.md b/docs/usage.md index 8cbf8ba4..b7fb4c94 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -50,10 +50,10 @@ doc_converter = DocumentConverter( ) ``` -To download all the artifacts needed to run offline, Docling provides the `docling-models download` utility. +To download all the artifacts needed to run offline, Docling provides the `docling-tools models download` utility. ```sh -$ docling-models download +$ docling-tools models download Downloading layout model... Downloading tableformer model... Downloading picture classifier model... diff --git a/pyproject.toml b/pyproject.toml index 21e99913..934aff8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,7 +125,7 @@ rapidocr = ["rapidocr-onnxruntime", "onnxruntime"] [tool.poetry.scripts] docling = "docling.cli.main:app" -docling-models = "docling.cli.models_download:app" +docling-tools = "docling.cli.tools:app" [build-system] requires = ["poetry-core"]