jiuface commited on
Commit
036ee43
1 Parent(s): bc3420d
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -30,7 +30,9 @@ def process_image(image_input, task_prompt, text_input) -> Optional[Image.Image]
30
  if not image_input:
31
  gr.Info("Please upload an image.")
32
  return None
33
-
 
 
34
  if not text_input:
35
  gr.Info("Please enter a text prompt.")
36
  return None
@@ -72,7 +74,7 @@ with gr.Blocks() as demo:
72
  "<CAPTION_TO_PHRASE_GROUNDING>",
73
  "<OPEN_VOCABULARY_DETECTION>",
74
  '<DENSE_REGION_CAPTION>'
75
- ], value="<CAPTION_TO_PHRASE_GROUNDING>", multiselect=True, label="Task Prompt", info="task prompts"
76
  ),
77
  text_input_component = gr.Textbox(label='Text prompt', placeholder='Enter text prompts')
78
  submit_button_component = gr.Button(value='Submit', variant='primary')
 
30
  if not image_input:
31
  gr.Info("Please upload an image.")
32
  return None
33
+ if not task_prompt:
34
+ gr.Info("Please enter a task prompt.")
35
+ return None
36
  if not text_input:
37
  gr.Info("Please enter a text prompt.")
38
  return None
 
74
  "<CAPTION_TO_PHRASE_GROUNDING>",
75
  "<OPEN_VOCABULARY_DETECTION>",
76
  '<DENSE_REGION_CAPTION>'
77
+ ], value="<CAPTION_TO_PHRASE_GROUNDING>", label="Task Prompt", info="task prompts"
78
  ),
79
  text_input_component = gr.Textbox(label='Text prompt', placeholder='Enter text prompts')
80
  submit_button_component = gr.Button(value='Submit', variant='primary')