mirror of
https://github.com/DS4SD/docling.git
synced 2025-07-31 14:34:40 +00:00
expose artifacts-path as argument
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
8902d1e208
commit
e60bdb570c
@ -163,6 +163,10 @@ def convert(
|
|||||||
TableFormerMode,
|
TableFormerMode,
|
||||||
typer.Option(..., help="The mode to use in the table structure model."),
|
typer.Option(..., help="The mode to use in the table structure model."),
|
||||||
] = TableFormerMode.FAST,
|
] = TableFormerMode.FAST,
|
||||||
|
artifacts_path: Annotated[
|
||||||
|
Optional[Path],
|
||||||
|
typer.Option(..., help="If provided, the location of the model artifacts."),
|
||||||
|
] = None,
|
||||||
abort_on_error: Annotated[
|
abort_on_error: Annotated[
|
||||||
bool,
|
bool,
|
||||||
typer.Option(
|
typer.Option(
|
||||||
@ -231,6 +235,9 @@ def convert(
|
|||||||
pipeline_options.table_structure_options.do_cell_matching = True # do_cell_matching
|
pipeline_options.table_structure_options.do_cell_matching = True # do_cell_matching
|
||||||
pipeline_options.table_structure_options.mode = table_mode
|
pipeline_options.table_structure_options.mode = table_mode
|
||||||
|
|
||||||
|
if artifacts_path is not None:
|
||||||
|
pipeline_options.artifacts_path = artifacts_path
|
||||||
|
|
||||||
match pdf_backend:
|
match pdf_backend:
|
||||||
case PdfBackend.DLPARSE_V1:
|
case PdfBackend.DLPARSE_V1:
|
||||||
backend: Type[PdfDocumentBackend] = DoclingParseDocumentBackend
|
backend: Type[PdfDocumentBackend] = DoclingParseDocumentBackend
|
||||||
|
Loading…
Reference in New Issue
Block a user