Ufoptg commited on
Commit
0600507
·
verified ·
1 Parent(s): 7ef63fe

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -3
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 nest_asyncio
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
- nest_asyncio.apply()
 
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
- nest_asyncio.unapply()
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