mestvnvo commited on
Commit
fd467af
·
1 Parent(s): f5104ed

fix empty input catch

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,8 +10,8 @@ You are given a short description of a person. Respond only with three different
10
  """
11
 
12
  def get_vibe(caption):
13
- if caption is None:
14
- return "No caption provided."
15
 
16
  messages = [
17
  {"role": "system", "content": system_instruction},
 
10
  """
11
 
12
  def get_vibe(caption):
13
+ if not caption or not caption.strip():
14
+ raise gr.Error("No caption provided.")
15
 
16
  messages = [
17
  {"role": "system", "content": system_instruction},