mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
Update server/text_generation_server/models/custom_modeling/idefics_image_processing.py
This commit is contained in:
parent
6cb066eb01
commit
d569a521a8
@ -181,7 +181,7 @@ class IdeficsImageProcessor(BaseImageProcessor):
|
|||||||
if isinstance(image_url_or_urls, list):
|
if isinstance(image_url_or_urls, list):
|
||||||
return [self.fetch_images(x) for x in image_url_or_urls]
|
return [self.fetch_images(x) for x in image_url_or_urls]
|
||||||
elif isinstance(image_url_or_urls, str):
|
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()
|
response.raise_for_status()
|
||||||
try:
|
try:
|
||||||
image = Image.open(BytesIO(response.content))
|
image = Image.open(BytesIO(response.content))
|
||||||
|
Loading…
Reference in New Issue
Block a user