Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -115,8 +115,13 @@ async def run_server(port: int):
|
|
115 |
async def serve_request(request: httpx.Request) -> httpx.Response:
|
116 |
return await handle_request(request)
|
117 |
|
118 |
-
|
119 |
-
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
def remove_repetitive_responses(responses):
|
122 |
unique_responses = {}
|
|
|
115 |
async def serve_request(request: httpx.Request) -> httpx.Response:
|
116 |
return await handle_request(request)
|
117 |
|
118 |
+
from uvicorn.config import Config
|
119 |
+
from uvicorn.main import Server
|
120 |
+
|
121 |
+
config = Config(app=serve_request, host="127.0.0.1", port=port, log_level="info")
|
122 |
+
server = Server(config=config)
|
123 |
+
|
124 |
+
await server.serve()
|
125 |
|
126 |
def remove_repetitive_responses(responses):
|
127 |
unique_responses = {}
|