Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -18,7 +18,7 @@
|
|
18 |
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19 |
|
20 |
import asyncio
|
21 |
-
import
|
22 |
import base64
|
23 |
import json
|
24 |
import logging
|
@@ -473,7 +473,8 @@ def gemini_pro(item: GeminiPro):
|
|
473 |
|
474 |
@app.post("/Bing/Dall-E-3")
|
475 |
async def bing_dalle(item: BingDalle):
|
476 |
-
|
|
|
477 |
try:
|
478 |
set_cookies(
|
479 |
".bing.com",
|
@@ -506,7 +507,7 @@ async def bing_dalle(item: BingDalle):
|
|
506 |
return {"status": "false", "message": f"Something went wrong: {e}"}
|
507 |
|
508 |
response = await main()
|
509 |
-
|
510 |
return response
|
511 |
|
512 |
|
|
|
18 |
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19 |
|
20 |
import asyncio
|
21 |
+
import NestedAsyncIO
|
22 |
import base64
|
23 |
import json
|
24 |
import logging
|
|
|
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",
|
|
|
507 |
return {"status": "false", "message": f"Something went wrong: {e}"}
|
508 |
|
509 |
response = await main()
|
510 |
+
nested_asyncio.revert()
|
511 |
return response
|
512 |
|
513 |
|