fix: extract response from api_image_request in picture description (#2571)

Signed-off-by: Peter El Hachem <peter.el.hachem@ibm.com>
Co-authored-by: Peter El Hachem <peter.el.hachem@ibm.com>
This commit is contained in:
peets
2025-11-04 08:39:15 +01:00
committed by GitHub
parent 3467b0a035
commit 8360aa5449

View File

@@ -51,7 +51,7 @@ class PictureDescriptionApiModel(PictureDescriptionBaseModel):
# Note: technically we could make a batch request here,
# but not all APIs will allow for it. For example, vllm won't allow more than 1.
def _api_request(image):
return api_image_request(
response, _ = api_image_request(
image=image,
prompt=self.options.prompt,
url=self.options.url,
@@ -60,5 +60,7 @@ class PictureDescriptionApiModel(PictureDescriptionBaseModel):
**self.options.params,
)
return response
with ThreadPoolExecutor(max_workers=self.concurrency) as executor:
yield from executor.map(_api_request, images)