mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-12 11:40:44 +08:00
@@ -9,10 +9,18 @@ import websockets.exceptions
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from loguru import logger
|
||||
from oasst_shared.schemas import inference, protocol
|
||||
from prometheus_fastapi_instrumentator import Instrumentator
|
||||
from sse_starlette.sse import EventSourceResponse
|
||||
|
||||
app = fastapi.FastAPI()
|
||||
|
||||
|
||||
# add prometheus metrics at /metrics
|
||||
@app.on_event("startup")
|
||||
async def enable_prom_metrics():
|
||||
Instrumentator().instrument(app).expose(app)
|
||||
|
||||
|
||||
# Allow CORS
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
fastapi[all]
|
||||
loguru
|
||||
prometheus-fastapi-instrumentator==5.9.1
|
||||
pydantic
|
||||
redis
|
||||
sse-starlette
|
||||
|
||||
Reference in New Issue
Block a user