Spaces:
Running
Running
Update main.py
Browse files
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 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
|
|
|
|
|
|
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")
|