Spaces:
Sleeping
Sleeping
empty image catch
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ pipe = pipeline("image-text-to-text",
|
|
9 |
)
|
10 |
|
11 |
def get_image_caption(image):
|
12 |
-
if image
|
13 |
-
|
14 |
|
15 |
image = image.convert("RGB")
|
16 |
|
|
|
9 |
)
|
10 |
|
11 |
def get_image_caption(image):
|
12 |
+
if not image:
|
13 |
+
raise gr.Error("No image provided.")
|
14 |
|
15 |
image = image.convert("RGB")
|
16 |
|