From c6ae14861ff955304b7f492bca76f9bc93aec89b Mon Sep 17 00:00:00 2001 From: Michele Dolfi Date: Sat, 9 Nov 2024 09:14:13 +0100 Subject: [PATCH] add example for cpu-only Signed-off-by: Michele Dolfi --- docs/examples/custom_convert.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/examples/custom_convert.py b/docs/examples/custom_convert.py index 204ae59f..34e918b5 100644 --- a/docs/examples/custom_convert.py +++ b/docs/examples/custom_convert.py @@ -80,6 +80,20 @@ def main(): } ) + # Docling Parse with EasyOCR (CPU only) + # ---------------------- + pipeline_options = PdfPipelineOptions() + pipeline_options.do_ocr = True + pipeline_options.ocr_options.use_gpu = False + pipeline_options.do_table_structure = True + pipeline_options.table_structure_options.do_cell_matching = True + + doc_converter = DocumentConverter( + format_options={ + InputFormat.PDF: PdfFormatOption(pipeline_options=pipeline_options) + } + ) + # Docling Parse with Tesseract # ---------------------- # pipeline_options = PdfPipelineOptions()