feat: expose code and formula models in the CLI

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi 2025-01-27 17:50:31 +01:00
parent a112d7a035
commit 9c6d9223bb

View File

@ -211,6 +211,14 @@ 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,
enrich_code: Annotated[
bool,
typer.Option(..., help="Enable the code enrichment model in the pipeline."),
] = False,
enrich_formula: Annotated[
bool,
typer.Option(..., help="Enable the formula enrichment model in the pipeline."),
] = False,
artifacts_path: Annotated[ artifacts_path: Annotated[
Optional[Path], Optional[Path],
typer.Option(..., help="If provided, the location of the model artifacts."), typer.Option(..., help="If provided, the location of the model artifacts."),
@ -365,6 +373,8 @@ def convert(
do_ocr=ocr, do_ocr=ocr,
ocr_options=ocr_options, ocr_options=ocr_options,
do_table_structure=True, do_table_structure=True,
do_code_enrichment=enrich_code,
do_formula_enrichment=enrich_formula,
document_timeout=document_timeout, document_timeout=document_timeout,
) )
pipeline_options.table_structure_options.do_cell_matching = ( pipeline_options.table_structure_options.do_cell_matching = (