Skip to content

Commit

Permalink
Update webui.py
Browse files Browse the repository at this point in the history
  • Loading branch information
neurogen-dev committed Aug 19, 2023
1 parent debc00a commit ce99a63
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import random
import time

import backend
from multiprocessing import Process

import logging
Expand Down Expand Up @@ -535,22 +536,8 @@ def run_gradio_server():
def run_api_server():
uvicorn.run("backend:app", host="127.0.0.1", port=1337)

async def run_backend():
app = web.Application()
# регистрация роутов и middleware

runner = web.AppRunner(app)
await runner.setup()

site = web.TCPSite(runner, '0.0.0.0', 1337)
await site.start()

# запуск сервера
print('Server started on http://127.0.0.1:1337')

asyncio.run(run_backend())

if __name__ == "__main__":
#api_process = Process(target=run_api_server)
#api_process.start()
api_process = Process(target=run_api_server)
api_process.start()

run_gradio_server()

0 comments on commit ce99a63

Please sign in to comment.