Update handler.py
Browse files- handler.py +7 -6
handler.py
CHANGED
@@ -269,12 +269,13 @@ class EndpointHandler:
|
|
269 |
input_image = inputs.get("image")
|
270 |
|
271 |
params = data.get("parameters", dict())
|
272 |
-
|
273 |
-
|
274 |
-
raise ValueError("
|
275 |
-
|
276 |
-
|
277 |
-
|
|
|
278 |
logger.info(f"Raw parameters:")
|
279 |
pprint.pprint(params)
|
280 |
|
|
|
269 |
input_image = inputs.get("image")
|
270 |
|
271 |
params = data.get("parameters", dict())
|
272 |
+
|
273 |
+
if not input_image and not input_prompt:
|
274 |
+
raise ValueError("Either prompt or image must be provided")
|
275 |
+
|
276 |
+
if input_prompt:
|
277 |
+
logger.info(f"Prompt: {input_prompt}")
|
278 |
+
|
279 |
logger.info(f"Raw parameters:")
|
280 |
pprint.pprint(params)
|
281 |
|