Views
No views yet
pip install TTS1from TTS.tts.configs.xtts_config import XttsConfig
2from TTS.tts.models.xtts import Xtts
3import torch
4
5# Load model
6config = XttsConfig()
7config.load_json("config.json")
8
9model = Xtts.init_from_config(config)
10model.load_checkpoint(
11 config,
12 checkpoint_path="model.pth",
13 vocab_path="vocab.json",
14 use_deepspeed=False,
15)
16model.cuda()
17model.eval()
18
19# Generate speech
20# Text should be in Cyrillic script
21text = "Селям алейкум! Бу къырымтатар тилинде сёйлеген модель."
22
23gpt_cond_latent, speaker_embedding = model.get_conditioning_latents(
24 audio_path="reference.wav"
25)
26
27out = model.inference(
28 text=text,
29 language="ru", # Use "ru" for Cyrillic text
30 gpt_cond_latent=gpt_cond_latent,
31 speaker_embedding=speaker_embedding,
32)
33
34# Save audio
35import torchaudio
36wav = torch.tensor(out["wav"]).unsqueeze(0)
37torchaudio.save("output.wav", wav, 24000)| Latin | Cyrillic |
|---|---|
| a | а |
| ğ | гъ |
| q | къ |
| ñ | нъ |
| j | ж |
| ş | ш |
| ç | ч |
1@misc{xtts-crh-sevil-v1,
2 author = {Servin Osmanov},
3 title = {XTTS Crimean Tatar - Sevil Voice},
4 year = {2026},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/servinosmanov/xtts-crh-sevil-v1}
7}