Skip to content

Commit 8360aa5

Browse files
ElHachem02Peter El Hachem
andauthored
fix: extract response from api_image_request in picture description (#2571)
Signed-off-by: Peter El Hachem <[email protected]> Co-authored-by: Peter El Hachem <[email protected]>
1 parent 3467b0a commit 8360aa5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docling/models/picture_description_api_model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _annotate_images(self, images: Iterable[Image.Image]) -> Iterable[str]:
5151
# Note: technically we could make a batch request here,
5252
# but not all APIs will allow for it. For example, vllm won't allow more than 1.
5353
def _api_request(image):
54-
return api_image_request(
54+
response, _ = api_image_request(
5555
image=image,
5656
prompt=self.options.prompt,
5757
url=self.options.url,
@@ -60,5 +60,7 @@ def _api_request(image):
6060
**self.options.params,
6161
)
6262

63+
return response
64+
6365
with ThreadPoolExecutor(max_workers=self.concurrency) as executor:
6466
yield from executor.map(_api_request, images)

0 commit comments

Comments
 (0)