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
+20
View File
@@ -0,0 +1,20 @@
import asyncio
from backend.tts_asr import _tts_sync_with_retry, _load_asr_pipeline_with_retry, _asr_pipeline
import base64
async def main():
text = "早上好"
print(f"Testing TTS with text: {text}")
audio_bytes, sr = await _tts_sync_with_retry(text, rate=1.0)
print(f"TTS generated {len(audio_bytes)} bytes of audio.")
print("Testing ASR...")
await _load_asr_pipeline_with_retry()
asr = _asr_pipeline
# Needs to process audio_bytes. ASR expects float32 numpy array or bytes?
# the pipeline takes bytes or dict with raw array
result = asr(audio_bytes)
print("ASR output:", result)
asyncio.run(main())