refactor: replace Kokoro-82M with suno/bark for TTS, update HF cache path, and add model warmup on startup.

This commit is contained in:
“ydy0615”
2026-04-06 13:40:41 +08:00
parent 7985fe9641
commit caf1ac1c01
8 changed files with 143 additions and 18 deletions
+10 -1
View File
@@ -1,4 +1,4 @@
import asyncio
import asyncio
import base64
import logging
import os
@@ -37,6 +37,15 @@ def _get_markitdown():
app = FastAPI()
@app.on_event("startup")
async def startup_event():
logger.info("Starting blocking preload for TTS and ASR models...")
try:
from tts_asr import _warmup_all
await _warmup_all()
except Exception as e:
logger.warning(f"Failed to initiate model warmup: {e}")
ACTIVE_COMPLETIONS: dict[str, asyncio.Task] = {}
ACTIVE_COMPLETIONS_LOCK = asyncio.Lock()