Repository navigation
feat(cli): generic engine options for docling convert - #4729
Conversation
Signed-off-by: Peter Staar <taa@zurich.ibm.com>
|
✅ DCO Check Passed Thanks @PeterStaar-IBM, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit Adds repeatable CI safety: no concern found. A maintainer must still approve CI. 4 related pull request(s) in the same code
The |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Let's not add docling convert --ocr-engine rapidocr --ocr-option model_size=tiny --ocr-option text_score=0.6 doc.pdfProposed spec:
|
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> # Conflicts: # tests/test_cli.py
…--table-structure-option
Replace the engine-specific `--rapidocr-model-size` flag of `convert` with
repeatable generic KEY=VALUE options for the OCR, layout and table
structure stages. Values are read as JSON when possible, else as strings,
and are validated against the selected engine's options class. Unknown
keys and keys that a dedicated flag (`--ocr-lang`, `--ocr-mode`,
`--table-mode`) also sets are rejected.
Add `docling options {ocr,layout,table-structure} [ENGINE]` to list the
keys, types and defaults of an engine. Deprecate `--psm` in favor of
`--ocr-option psm=N`.
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
Summary
--ocr-option,--layout-optionand--table-structure-option KEY=VALUEtodocling convert. Each one fills the options of the engine selected with--ocr-engine,--layout-engineor--table-structure-engine, so plugin engines work with no extra code.0.6,false,["en","de"]), else as strings. Pydantic validates them against the engine's options class.--ocr-lang,--ocr-mode,--table-mode) fails too.docling options {ocr,layout,table-structure} [ENGINE]to list the keys, types, defaults and descriptions of an engine.--psmin favor of--ocr-option psm=N.The new options are for local
convertonly.convert-remotedoes not forward them, because some fields hold paths or commands.docling-tools models download --rapidocr-model-sizeis unchanged.