Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -473,8 +473,6 @@ def gemini_pro(item: GeminiPro):
|
|
| 473 |
|
| 474 |
@app.post("/Bing/Dall-E-3")
|
| 475 |
async def bing_dalle(item: BingDalle):
|
| 476 |
-
# nested_asyncio = NestedAsyncIO()
|
| 477 |
-
# nested_asyncio.apply()
|
| 478 |
try:
|
| 479 |
set_cookies(
|
| 480 |
".bing.com",
|
|
@@ -499,16 +497,12 @@ async def bing_dalle(item: BingDalle):
|
|
| 499 |
except BaseException as e:
|
| 500 |
return {"status": "false", "message": f"Internal Error: {e}"}
|
| 501 |
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
return {"status": "false", "message": f"Something went wrong: {e}"}
|
| 508 |
|
| 509 |
-
response = await main()
|
| 510 |
-
# nested_asyncio.revert()
|
| 511 |
-
return response
|
| 512 |
|
| 513 |
|
| 514 |
@app.post("/UFoP/dalle3xl")
|
|
|
|
| 473 |
|
| 474 |
@app.post("/Bing/Dall-E-3")
|
| 475 |
async def bing_dalle(item: BingDalle):
|
|
|
|
|
|
|
| 476 |
try:
|
| 477 |
set_cookies(
|
| 478 |
".bing.com",
|
|
|
|
| 497 |
except BaseException as e:
|
| 498 |
return {"status": "false", "message": f"Internal Error: {e}"}
|
| 499 |
|
| 500 |
+
try:
|
| 501 |
+
response = await generate_image(item.prompt, item.model)
|
| 502 |
+
return response
|
| 503 |
+
except BaseException as e:
|
| 504 |
+
return {"status": "false", "message": f"Something went wrong: {e}"}
|
|
|
|
| 505 |
|
|
|
|
|
|
|
|
|
|
| 506 |
|
| 507 |
|
| 508 |
@app.post("/UFoP/dalle3xl")
|