anhdt-dsai-02
commited on
Commit
•
556abe1
1
Parent(s):
c1859c3
fix bug
Browse files
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 |
-
|
87 |
-
|
88 |
-
if caption
|
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
|