add validation
Browse files
serve/gradio_web_server.py
CHANGED
@@ -114,10 +114,13 @@ def clear_history(request: gr.Request):
|
|
114 |
|
115 |
def add_text(state, text, image, image_process_mode, request: gr.Request):
|
116 |
# logger.info(f"add_text. ip: {request.client.host}. len: {len(text)}")
|
|
|
117 |
if not text:
|
|
|
118 |
raise gr.Error("Please provide a prompt.")
|
119 |
|
120 |
if not image:
|
|
|
121 |
raise gr.Error("Please provide an image.")
|
122 |
|
123 |
if len(text) <= 0 and image is None:
|
|
|
114 |
|
115 |
def add_text(state, text, image, image_process_mode, request: gr.Request):
|
116 |
# logger.info(f"add_text. ip: {request.client.host}. len: {len(text)}")
|
117 |
+
print(text, image)
|
118 |
if not text:
|
119 |
+
print("text empty")
|
120 |
raise gr.Error("Please provide a prompt.")
|
121 |
|
122 |
if not image:
|
123 |
+
print("image not provided")
|
124 |
raise gr.Error("Please provide an image.")
|
125 |
|
126 |
if len(text) <= 0 and image is None:
|