Initial implementation: Chatterbox TTS with ROCm and Wyoming
All checks were successful
Build ROCm Image / build (push) Successful in 15m27s
All checks were successful
Build ROCm Image / build (push) Successful in 15m27s
Wyoming-only server built around the official chatterbox TTS model. Includes ROCm/AMD GPU support, sentence-level streaming, config.yaml management, and Gitea CI for container builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
42
main.py
Normal file
42
main.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import asyncio
|
||||
import logging
|
||||
import sys
|
||||
from functools import partial
|
||||
|
||||
from wyoming.server import AsyncServer
|
||||
|
||||
import engine
|
||||
from config import get_wyoming_host, get_wyoming_port, load_config
|
||||
from wyoming_handler import ChatterboxWyomingHandler
|
||||
from wyoming_voices import create_wyoming_info, load_voices
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s %(levelname)s %(name)s: %(message)s",
|
||||
stream=sys.stdout,
|
||||
)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
load_config()
|
||||
|
||||
logger.info("Loading TTS model...")
|
||||
if not engine.load_model():
|
||||
logger.error("Failed to load model, exiting")
|
||||
sys.exit(1)
|
||||
|
||||
voices = load_voices()
|
||||
wyoming_info = create_wyoming_info(engine.get_sample_rate(), voices)
|
||||
|
||||
host = get_wyoming_host()
|
||||
port = get_wyoming_port()
|
||||
uri = f"tcp://{host}:{port}"
|
||||
|
||||
logger.info(f"Starting Wyoming server on {uri}")
|
||||
server = AsyncServer.from_uri(uri)
|
||||
await server.run(partial(ChatterboxWyomingHandler, wyoming_info, voices))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user