This model is a fine-tuned version of
Coqui's XTTS-v2 designed to support multiple Ugandan languages.
The model was trained with special language tokens natively injected into the vocabulary:
1from TTS.api import TTS
2
3# 1. Download the repo and set the paths to the local directory
4model_dir = "./xtts-ug-lang"
5config_path = f"{model_dir}/config.json"
6
7# 2. Initialize the TTS API
8tts = TTS(
9 model_path=model_dir,
10 config_path=config_path
11)
12
13# 3. Generate Audio
14# Pass language="en" to bypass strict checks, but prepend the real language tag to the text.
15text_to_speak = "[lg] Ekiseera kino kyamagero."
16
17tts.tts_to_file(
18 text=text_to_speak,
19 speaker_wav="path/to/reference/speaker.wav", # Your reference audio for voice cloning
20 language="en",
21 file_path="output.wav"
22)
23print("Audio generated successfully!")