Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new artifacts path for old and new models and CLI utility #876

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dolfim-ibm
Copy link
Contributor

@dolfim-ibm dolfim-ibm commented Feb 3, 2025

Fix the location of local models for CodeFormula and PictureClassifier.

When the parameter artifacts_path is provided, the folder must have the following structure:

./mymodels/
├── CodeFormula/               # optional, only when activated
├── DocumentFigureClassifier/  # optional, only when activated
└── docling-models/
    └── model_artifacts/
        ├── layout/
        └── tableformer/

For backwards compatibility, we still support setting artifacts_path=mymodels/docling-models, but a deprecation warning is raised.

New CLI utility to download all model artifacts:

$ docling-models download
Downloading layout model...
Fetching 11 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 11/11 [00:00<00:00, 5200.92it/s]
Downloading tableformer model...
Fetching 11 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 11/11 [00:00<00:00, 3944.37it/s]
Downloading picture classifier model...
Fetching 4 files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 1050.74it/s]
Downloading code formula model...
Fetching 12 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 1990.49it/s]
Downloading easyocr models...
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 73.7M/73.7M [00:04<00:00, 16.9MB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.4M/13.4M [00:00<00:00, 14.3MB/s]
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.6M/13.6M [00:00<00:00, 15.5MB/s]
All models downloaded in the directory /Users/dol/.cache/docling/models.

 Docling can now be configured for running offline using the local artifacts.

 Using the CLI: docling --artifacts-path={output_dir} FILE 
 Using Python: see the documentation at <https://ds4sd.github.io/docling/usage>.

Issue resolved by this Pull Request:
Resolves #870

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Copy link

mergify bot commented Feb 3, 2025

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@dolfim-ibm dolfim-ibm marked this pull request as ready for review February 3, 2025 20:59
@dolfim-ibm dolfim-ibm requested a review from cau-git February 3, 2025 20:59
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
@dolfim-ibm dolfim-ibm changed the title fix: new artifacts path for old and new models feat: new artifacts path for old and new models and CLI utility Feb 4, 2025
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set artifacts_path for picture classifier
1 participant