Views
No views yet
| Attribute | Value |
|---|---|
| Base Model | coqui/XTTS-v2 |
| Method | Speaker Conditioning |
| Language | Swahili (Kiswahili) |
| Training Data | OpenSLR SLR25 (11.49 hours) |
| Reference Samples | 100 audio clips |
| Developed by | Eryx Labs |
1import torch
2from TTS.tts.configs.xtts_config import XttsConfig
3from TTS.tts.models.xtts import Xtts
4from huggingface_hub import hf_hub_download
5
6# Download speaker embeddings
7embedding_path = hf_hub_download(
8 repo_id="EryxLabs/eryx-swahili-tts-v1",
9 filename="swahili_speaker.pt"
10)
11
12# Load XTTS-v2 model
13model_path = "path/to/xtts_v2" # or download from coqui
14config = XttsConfig()
15config.load_json(f"{model_path}/config.json")
16model = Xtts.init_from_config(config)
17model.load_checkpoint(config, checkpoint_dir=model_path, eval=True)
18
19# Load Swahili speaker embeddings
20embeddings = torch.load(embedding_path)
21gpt_cond_latent = embeddings['gpt_cond_latent']
22speaker_embedding = embeddings['speaker_embedding']
23
24# Synthesize Swahili text
25# Note: Use 'en' for language since XTTS-v2 doesn't support 'sw' directly
26out = model.inference(
27 text="Habari yako, mimi ni msaidizi wa Kiswahili.",
28 language="en", # Swahili uses Latin script, works with English tokenizer
29 gpt_cond_latent=gpt_cond_latent,
30 speaker_embedding=speaker_embedding,
31)
32
33# Save audio
34import torchaudio
35torchaudio.save("output.wav", torch.tensor(out["wav"]).unsqueeze(0), 24000)swahili_speaker.pt - Speaker embeddings (gpt_cond_latent + speaker_embedding)samples/ - Example synthesized audio files1@misc{eryx-swahili-tts,
2 author = {Eryx Labs},
3 title = {eryx-swahili-tts-v1: Swahili Text-to-Speech Speaker Embeddings},
4 year = {2025},
5 publisher = {Eryx Labs},
6 url = {https://eryxlabs.co.ke}
7}