add validation
Browse files
serve/gradio_web_server.py
CHANGED
@@ -114,11 +114,11 @@ 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 |
-
|
119 |
|
120 |
-
if not image:
|
121 |
-
|
122 |
|
123 |
if len(text) <= 0 and image is None:
|
124 |
state.skip_next = True
|
|
|
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:
|
124 |
state.skip_next = True
|