ysharma HF staff commited on
Commit
c56aaaf
1 Parent(s): 73e0a52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -48,10 +48,10 @@ def bot_streaming(message, history):
48
  try:
49
  if image is None:
50
  # Handle the case where image is None
51
- gr.Error("You need to upload an image for FalconVLM to work.")
52
  except NameError:
53
  # Handle the case where 'image' is not defined at all
54
- gr.Error("You need to upload an image for FalconVLM to work.")
55
 
56
  prompt = f"""User:<image>\n{message['text']} Falcon:"""
57
  image = Image.open(image)
@@ -89,5 +89,4 @@ with gr.Blocks(fill_height=True, ) as demo:
89
  )
90
 
91
  demo.queue()
92
- demo.launch()
93
-
 
48
  try:
49
  if image is None:
50
  # Handle the case where image is None
51
+ raise gr.Error("You need to upload an image for FalconVLM to work. Close the error and try again with an Image.")
52
  except NameError:
53
  # Handle the case where 'image' is not defined at all
54
+ raise gr.Error("You need to upload an image for FalconVLM to work. Close the error and try again with an Image.")
55
 
56
  prompt = f"""User:<image>\n{message['text']} Falcon:"""
57
  image = Image.open(image)
 
89
  )
90
 
91
  demo.queue()
92
+ demo.launch()