refactor: replace Kokoro-82M with suno/bark for TTS, update HF cache path, and add model warmup on startup.
This commit is contained in:
+10
-1
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user