Update app.py
Browse files
app.py
CHANGED
@@ -111,10 +111,12 @@ def process_image(image_input, unit):
|
|
111 |
|
112 |
|
113 |
def main(text_input="", image_input=None, unit=""):
|
114 |
-
if text_input and image_input is None:
|
115 |
return process_text(text_input,unit)
|
116 |
elif image_input is not None:
|
117 |
return process_image(image_input,unit)
|
|
|
|
|
118 |
|
119 |
EXAMPLES = [
|
120 |
["./docs/estate.jpeg","",],
|
|
|
111 |
|
112 |
|
113 |
def main(text_input="", image_input=None, unit=""):
|
114 |
+
if text_input != "" and image_input is None:
|
115 |
return process_text(text_input,unit)
|
116 |
elif image_input is not None:
|
117 |
return process_image(image_input,unit)
|
118 |
+
else:
|
119 |
+
gr.Error("请输入内容或者上传图片")
|
120 |
|
121 |
EXAMPLES = [
|
122 |
["./docs/estate.jpeg","",],
|