Spaces:
Running
on
Zero
Running
on
Zero
import asyncio | |
import uvicorn | |
from app import demo | |
from api import app | |
async def run_servers(): | |
config = uvicorn.Config(app=app, host="0.0.0.0", port=8000) | |
server = uvicorn.Server(config) | |
fastapi_task = asyncio.create_task(server.serve()) | |
demo.launch(server_name="0.0.0.0", server_port=7860) | |
await fastapi_task | |
if __name__ == "__main__": | |
asyncio.run(run_servers()) |