simpler health check
This commit is contained in:
parent
efed057896
commit
98c102d0ef
1 changed files with 5 additions and 7 deletions
12
main.py
12
main.py
|
|
@ -7,7 +7,7 @@ import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import yaml
|
import yaml
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from fastapi.responses import StreamingResponse, JSONResponse
|
from fastapi.responses import StreamingResponse, Response
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
import uvicorn
|
import uvicorn
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
@ -57,13 +57,11 @@ app.add_middleware(
|
||||||
allow_headers=["*"]
|
allow_headers=["*"]
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.get("/livez")
|
@app.get("/")
|
||||||
async def livez():
|
@app.head("/")
|
||||||
return "OK"
|
|
||||||
|
|
||||||
@app.options("/")
|
@app.options("/")
|
||||||
async def options():
|
async def root() -> Response:
|
||||||
return JSONResponse(content="OK")
|
return Response(status_code=200, content="", media_type="text/plain")
|
||||||
|
|
||||||
class GenerateSpeechRequest(BaseModel):
|
class GenerateSpeechRequest(BaseModel):
|
||||||
model: str = "tts-1" # or "tts-1-hd"
|
model: str = "tts-1" # or "tts-1-hd"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue