Update server/text_generation_server/models/custom_modeling/idefics_image_processing.py

This commit is contained in:
Nicolas Patry 2023-10-03 10:24:19 +02:00 committed by GitHub
parent 6cb066eb01
commit d569a521a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,7 +181,7 @@ class IdeficsImageProcessor(BaseImageProcessor):
if isinstance(image_url_or_urls, list):
return [self.fetch_images(x) for x in image_url_or_urls]
elif isinstance(image_url_or_urls, str):
response = requests.get(image_url_or_urls, stream=True, headers=headers)
response = requests.get(image_url_or_urls, stream=True, headers=headers, timeout=(1, 5))
response.raise_for_status()
try:
image = Image.open(BytesIO(response.content))