docs: fix correct Accelerator pipeline options in docs/examples/custom_convert.py (#733)
* 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> * apply formatting Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> --------- Signed-off-by: Iacopo Ghinassi <45108036+Ighina@users.noreply.github.com> Signed-off-by: Michele Dolfi <dol@zurich.ibm.com> Co-authored-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
parent
57fc28d3d8
commit
768608351d
@ -5,7 +5,11 @@ 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 +80,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(
|
||||
|
Loading…
Reference in New Issue
Block a user