mestvnvo commited on
Commit
7ab2903
·
1 Parent(s): 2ef3d5b

empty image catch

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,8 +9,8 @@ pipe = pipeline("image-text-to-text",
9
  )
10
 
11
  def get_image_caption(image):
12
- if image is None:
13
- return "No image provided."
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