Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -67,8 +67,12 @@ async def process_inputs(class_names: List[str], image_url: str):
|
|
67 |
return
|
68 |
|
69 |
yield "##### β Fetching image and running model..."
|
70 |
-
|
71 |
-
|
|
|
|
|
|
|
|
|
72 |
|
73 |
class_items = class_names.split(",")
|
74 |
class_likelihoods = get_similarity_scores(class_items, pil_img)
|
|
|
67 |
return
|
68 |
|
69 |
yield "##### β Fetching image and running model..."
|
70 |
+
try:
|
71 |
+
pil_img = await open_image_url(image_url)
|
72 |
+
img = pn.pane.Image(pil_img, height=400, align="center")
|
73 |
+
except Exception as e:
|
74 |
+
yield f"##### π Something went wrong, please try a different URL!"
|
75 |
+
return
|
76 |
|
77 |
class_items = class_names.split(",")
|
78 |
class_likelihoods = get_similarity_scores(class_items, pil_img)
|