docs: support running examples from root or subfolder (#1816)

support running examples from root or subfolder

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi
2025-06-19 04:10:40 -05:00
committed by GitHub
parent dd7f64ff28
commit 64ac043786
13 changed files with 33 additions and 21 deletions

View File

@@ -10,7 +10,8 @@ from docling.document_converter import DocumentConverter, PdfFormatOption
def main():
input_doc = Path("./tests/data/pdf/2206.01062.pdf")
data_folder = Path(__file__).parent / "../../tests/data"
input_doc_path = data_folder / "pdf/2206.01062.pdf"
# Explicitly set the accelerator
# accelerator_options = AcceleratorOptions(
@@ -47,7 +48,7 @@ def main():
settings.debug.profile_pipeline_timings = True
# Convert the document
conversion_result = converter.convert(input_doc)
conversion_result = converter.convert(input_doc_path)
doc = conversion_result.document
# List with total time per document