ai-experiment/config/tts.py

23 lines
821 B
Python
Raw Normal View History

2026-09-18 17:02:51 +07:00
from config.model import MODEL_DIR
ZIPVOICE = MODEL_DIR / "zipvoice"
TOKENS = ZIPVOICE / "tokens.txt"
ENCODER = ZIPVOICE / "encoder.int8.onnx"
DECODER = ZIPVOICE / "decoder.int8.onnx"
DATA_DIR = ZIPVOICE / "espeak-ng-data"
LEXICON = ZIPVOICE / "lexicon.txt"
VOCODER = ZIPVOICE / "vocos_24khz.onnx"
# Reference voice for zero-shot voice cloning.
# REFERENCE_TEXT must match what is spoken in REFERENCE_AUDIO exactly,
# otherwise the cloned voice quality will noticeably degrade.
REFERENCE_AUDIO = ZIPVOICE / "test_wavs" / "leijun-1.wav"
REFERENCE_TEXT = "那还是三十六年前, 一九八七年. 我呢考上了武汉大学的计算机系."
NUM_THREADS = 2
PROVIDER = "cpu"
NUM_STEPS = 4 # Generation quality/speed tradeoff (higher = better, slower)
# Default output filename.
OUTPUT_FILE = "output.wav"