fuyu attempted fix

pull/128/head
Kye 1 year ago
parent 8cb88dbc16
commit bcf2b88873

@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "swarms"
version = "2.2.0"
version = "2.2.1"
description = "Swarms - Pytorch"
license = "MIT"
authors = ["Kye Gomez <kye@apac.ai>"]

@ -75,6 +75,13 @@ class Fuyu:
def get_img_from_web(self, img_url: str):
"""Get the image from the web"""
response = requests.get(img_url)
image_pil = Image.open(BytesIO(response.content))
return image_pil
try:
response = requests.get(img_url)
response.raise_for_status()
image_pil = Image.open(BytesIO(response.content))
return image_pil
except requests.RequestException as error:
print(f"Error fetching image from {img_url} and error: {error}")
return None
Loading…
Cancel
Save