| --- |
| language: |
| - lg |
| - ach |
| - nyn |
| - en |
| - mas |
| - sog |
| tags: |
| - text-to-speech |
| - xtts |
| - coqui |
| - uganda |
| license: other |
| --- |
| |
| # XTTS Ugandan Languages (xtts-ug-lang) |
|
|
| This model is a fine-tuned version of [Coqui's XTTS-v2](https://huggingface.co/coqui/XTTS-v2) designed to support multiple Ugandan languages. |
|
|
| ## Supported Languages |
| The model was trained with special language tokens natively injected into the vocabulary: |
| - **Luganda** (`[lg]`) |
| - **Acholi** (`[ach]`) |
| - **Masaaba** (`[mas]`) |
| - **Runyankore** (`[nyn]`) |
| - **Soga** (`[sog]`) |
| - **Ugandan English** (`[en-ug]`) |
|
|
| ## Dataset |
| Trained on the `reuben256/votex-v1` dataset comprising over 248 hours of high-quality speech data. |
|
|
| ## Training Details |
| - Fine-tuned using the XTTS GPT trainer. |
| - The base model's embedding matrices were successfully patched and resized to support the new vocabulary IDs. |
|
|
| ## Usage |
| To use this with the standard Coqui `TTS` library, download the repository and load it locally. Make sure you use the patched `config.json` and `vocab.json` included in this repository. |
|
|
| Because the underlying library has strict language validation, you should set `language="en"` in the API call but include your specific language token (e.g., `[lg]`) directly inside the text string. |
|
|
| ### Python Example |
|
|
| ```python |
| from TTS.api import TTS |
| |
| # 1. Download the repo and set the paths to the local directory |
| model_dir = "./xtts-ug-lang" |
| config_path = f"{model_dir}/config.json" |
| |
| # 2. Initialize the TTS API |
| tts = TTS( |
| model_path=model_dir, |
| config_path=config_path |
| ) |
| |
| # 3. Generate Audio |
| # Pass language="en" to bypass strict checks, but prepend the real language tag to the text. |
| text_to_speak = "[lg] Ekiseera kino kyamagero." |
| |
| tts.tts_to_file( |
| text=text_to_speak, |
| speaker_wav="path/to/reference/speaker.wav", # Your reference audio for voice cloning |
| language="en", |
| file_path="output.wav" |
| ) |
| print("Audio generated successfully!") |
| ``` |
|
|