-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.py
More file actions
33 lines (20 loc) · 747 Bytes
/
server.py
File metadata and controls
33 lines (20 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Combined TTS + STT server. Mounts both APIs under one process."""
from pathlib import Path
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from config import HOST, PORT
app = FastAPI(title="GPU TTS + STT Server", version="1.0.0")
FRONTEND = Path(__file__).parent / "index.html"
@app.get("/", response_class=HTMLResponse)
def index():
return FRONTEND.read_text()
@app.get("/health")
def health():
return {"status": "ok", "services": ["tts", "stt"]}
from stt_server import app as stt_app # noqa: E402
from tts_server import app as tts_app # noqa: E402
app.mount("/tts", tts_app)
app.mount("/stt", stt_app)
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host=HOST, port=int(PORT))