From 45c5a9445a321b09ffcfa455f43ae99607486067 Mon Sep 17 00:00:00 2001 From: Vinay Damodaran Date: Wed, 7 May 2025 20:50:52 -0700 Subject: [PATCH] Use yield from correctly? Signed-off-by: Vinay Damodaran --- docling/models/api_vlm_model.py | 3 +-- docling/models/picture_description_api_model.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docling/models/api_vlm_model.py b/docling/models/api_vlm_model.py index f11e08d8..acad8a70 100644 --- a/docling/models/api_vlm_model.py +++ b/docling/models/api_vlm_model.py @@ -70,5 +70,4 @@ class ApiVlmModel(BasePageModel): return page with ThreadPoolExecutor(max_workers=concurrency) as executor: - for result in executor.map(_vlm_request, page_batch): - yield from result + yield from executor.map(_vlm_request, page_batch) diff --git a/docling/models/picture_description_api_model.py b/docling/models/picture_description_api_model.py index 2c19759d..2debc839 100644 --- a/docling/models/picture_description_api_model.py +++ b/docling/models/picture_description_api_model.py @@ -62,5 +62,4 @@ class PictureDescriptionApiModel(PictureDescriptionBaseModel): ) with ThreadPoolExecutor(max_workers=concurrency) as executor: - for result in executor.map(_api_request, images): - yield from result + yield from executor.map(_api_request, images)