anhdt-dsai-02 commited on
Commit
556abe1
1 Parent(s): c1859c3
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -80,12 +80,13 @@ def get_image_bytes(image):
80
 
81
  # Define a function to handle image and text caption
82
  def process_image_and_caption(username_input, image, caption):
 
83
  if image is None:
84
  gr.Warning("No image uploaded!", duration=5)
85
  return "No image uploaded!", image, caption
86
- print("here is cation" + caption)
87
- print("here is cation type" + str(type(caption)))
88
- if caption is None:
89
  gr.Warning("No caption uploaded!", duration=5)
90
  return "No caption uploaded!", image, caption
91
  # Get current time in GMT+7
 
80
 
81
  # Define a function to handle image and text caption
82
  def process_image_and_caption(username_input, image, caption):
83
+ #check image
84
  if image is None:
85
  gr.Warning("No image uploaded!", duration=5)
86
  return "No image uploaded!", image, caption
87
+
88
+ # check caption
89
+ if not caption.strip():
90
  gr.Warning("No caption uploaded!", duration=5)
91
  return "No caption uploaded!", image, caption
92
  # Get current time in GMT+7