fuyu attempted fix

Former-commit-id: bcf2b88873
grit/923f7c6f-0958-480b-8748-ea6bbf1c2084 2.2.1
Kye 1 year ago
parent 7c87a37ec8
commit 7bf0f75bf1

@ -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