mirror of
https://github.com/DS4SD/docling.git
synced 2025-08-02 07:22:14 +00:00
rename utility to docling-tools
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
654ce001da
commit
0f830a6ac9
@ -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)
|
||||
|
17
docling/cli/tools.py
Normal file
17
docling/cli/tools.py
Normal file
@ -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()
|
@ -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(
|
||||
|
@ -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...
|
||||
|
@ -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"]
|
||||
|
Loading…
Reference in New Issue
Block a user