Loading…
Loading…
An advanced Russian Text-to-Speech (TTS) and voice cloning model based on the DiT (Diffusion Transformer) / Flow-Matching architecture (F5-TTS). Fine-tuned on high-fidelity, expressive theatrical dialogues with lexical stress annotation.
gradio.live link to use the Web UI.+ markers before stressed vowels (e.g., прив+ет, к+ак дел+а?) for natural pronunciation and homograph disambiguation..safetensors (zero pickle risks, instantaneous tensor loading).pip install f5-tts soundfile torchaudio
import torch
import soundfile as sf
from f5_tts.infer.utils_infer import infer_process, load_model, load_vocoder
from f5_tts.model import DiT
device = "cuda" if torch.cuda.is_available() else "cpu"
# Load neural vocoder
vocoder = load_vocoder(vocoder_name="vocos", device=device)
# Load acoustic DiT model
model_cfg = dict(dim=1024, depth=22, heads=16, ff_mult=2, text_dim=512, conv_layers=4)
model = load_model(
DiT,
model_cfg,
"model.safetensors",
vocab_file="vocab.txt",
device=device
)
# Zero-shot inference
wave, sr, _ = infer_process(
ref_audio="reference.wav",
ref_text="Текст из образца голоса",
gen_text="Прив+ет! Это русская нейрос+еть для озв+учки.",
model_obj=model,
vocoder=vocoder,
device=device,
nfe_step=32,
speed=1.0
)
sf.write("output.wav", wave, sr)
langswap/dialogs-ru-emotional-conversations).bitsandbytes) with dynamic batching.