Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -501,13 +501,17 @@ async def bing_dalle(item: BingDalle):
|
|
501 |
|
502 |
try:
|
503 |
response = await generate_image(item.prompt, item.model)
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
|
|
|
|
|
|
|
|
508 |
return {"status": "true", "sukuna": {"message": image_url}}
|
509 |
else:
|
510 |
-
return {"status": "false", "message": f"No image URL found in the {response
|
511 |
except BaseException as e:
|
512 |
return {"status": "false", "message": f"Something went wrong: {e}"}
|
513 |
|
|
|
501 |
|
502 |
try:
|
503 |
response = await generate_image(item.prompt, item.model)
|
504 |
+
except BaseException as e:
|
505 |
+
return {"status": "false", "message": f"Something went wrong: {e}"}
|
506 |
+
try:
|
507 |
+
image_url = response.data[0].url
|
508 |
+
except BaseException as e:
|
509 |
+
return {"status": "false", "message": f"No image URL found in the {response} Error: {e}"
|
510 |
+
|
511 |
+
if image_url is not None:
|
512 |
return {"status": "true", "sukuna": {"message": image_url}}
|
513 |
else:
|
514 |
+
return {"status": "false", "message": f"No image URL found in the {response}"}
|
515 |
except BaseException as e:
|
516 |
return {"status": "false", "message": f"Something went wrong: {e}"}
|
517 |
|