Ufoptg commited on
Commit
3ebdf67
1 Parent(s): 9d5a2a7

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +9 -5
main.py CHANGED
@@ -17,6 +17,7 @@
17
  # You should have received a copy of the GNU Affero General Public License
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
 
 
20
  import base64
21
  import json
22
  import logging
@@ -495,11 +496,14 @@ async def bing_dalle(item: BingDalle):
495
  except BaseException as e:
496
  return {"status": "false", "message": f"Internal Error: {e}"}
497
 
498
- try:
499
- response = await generate_image(item.prompt, item.model)
500
- return response
501
- except BaseException as e:
502
- return {"status": "false", "message": f"Something went wrong: {e}"}
 
 
 
503
 
504
 
505
  @app.post("/UFoP/dalle3xl")
 
17
  # You should have received a copy of the GNU Affero General Public License
18
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
 
20
+ import asyncio
21
  import base64
22
  import json
23
  import logging
 
496
  except BaseException as e:
497
  return {"status": "false", "message": f"Internal Error: {e}"}
498
 
499
+ async def main():
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
+ return await main()
507
 
508
 
509
  @app.post("/UFoP/dalle3xl")