From 188789b221170dcbf662caa75186bf6d3f7262f4 Mon Sep 17 00:00:00 2001 From: Iacopo Ghinassi <45108036+Ighina@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:05:27 +0000 Subject: [PATCH] Update custom_convert.py Added the missing AcceleratorDevice and AcceleratorOptions functions in the imports and changed Device in the code to the correct AcceleratorDevice Signed-off-by: Iacopo Ghinassi <45108036+Ighina@users.noreply.github.com> --- docs/examples/custom_convert.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/examples/custom_convert.py b/docs/examples/custom_convert.py index a7efa975..3c335aba 100644 --- a/docs/examples/custom_convert.py +++ b/docs/examples/custom_convert.py @@ -5,7 +5,7 @@ from pathlib import Path from docling.backend.pypdfium2_backend import PyPdfiumDocumentBackend from docling.datamodel.base_models import InputFormat -from docling.datamodel.pipeline_options import PdfPipelineOptions +from docling.datamodel.pipeline_options import AcceleratorDevice, AcceleratorOptions, PdfPipelineOptions from docling.document_converter import DocumentConverter, PdfFormatOption from docling.models.ocr_mac_model import OcrMacOptions from docling.models.tesseract_ocr_cli_model import TesseractCliOcrOptions @@ -76,7 +76,7 @@ def main(): pipeline_options.table_structure_options.do_cell_matching = True pipeline_options.ocr_options.lang = ["es"] pipeline_options.accelerator_options = AcceleratorOptions( - num_threads=4, device=Device.AUTO + num_threads=4, device=AcceleratorDevice.AUTO ) doc_converter = DocumentConverter(