Instructions to use Afrilab/HanwaTTS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Afrilab/HanwaTTS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="Afrilab/HanwaTTS")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForTextToSpectrogram processor = AutoProcessor.from_pretrained("Afrilab/HanwaTTS") model = AutoModelForTextToSpectrogram.from_pretrained("Afrilab/HanwaTTS", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- HanwaTTS
HanwaTTS
HanwaTTS is a Hausa Text-to-Speech (TTS) model fine-tuned from Microsoft's microsoft/speecht5_tts architecture for Hausa speech synthesis.
The model is designed for Hausa-language speech generation and low-resource African-language speech research.
Model Overview
| Property | Value |
|---|---|
| Model | HanwaTTS |
| Architecture | SpeechT5 |
| Base model | microsoft/speecht5_tts |
| Language | Hausa (ha) |
| Task | Text-to-Speech |
| Sample rate | 16 kHz |
| Speaker embedding dimension | 512 |
| Training samples | 3,572 paired Hausa text/audio samples |
| Evaluation samples | 684 |
| WER | 0.2352 |
| CER | 0.0354 |
| Text/phonetic processing | Epitran hau-Latn |
| Vocoder | microsoft/speecht5_hifigan |
Intended Use
HanwaTTS can be used for:
- Hausa conversational AI
- Voice assistants
- Educational applications
- Accessibility applications
- Hausa content generation
- Speech research
- Low-resource language research
- Prototyping Hausa voice interfaces
- Multilingual AI systems
The model is intended primarily for research, development, and responsible production applications where appropriate evaluation and human oversight are possible.
Training Data
HanwaTTS was fine-tuned using an internal Hausa speech dataset recorded by Afrilab AI Hub in its own recording studio.
The training set contained:
- 3,572 paired Hausa text/audio samples
- Hausa speech recordings
- Corresponding text transcriptions
Epitran with the hau-Latn configuration was used as part of the text/phonetic processing pipeline.
The underlying recordings are not redistributed as part of this repository.
Training
HanwaTTS is based on the SpeechT5 text-to-speech architecture.
The fine-tuning process adapted the pretrained SpeechT5 model to Hausa speech using paired Hausa text and speech data.
The model uses 512-dimensional speaker embeddings during inference.
Evaluation
The model was evaluated on a held-out set of 684 samples.
The reported ASR-based evaluation results were:
| Metric | Result |
|---|---|
| WER | 0.2792 |
| CER | 0.0452 |
These metrics are based on automatic speech recognition evaluation and should not be interpreted as direct measurements of human-perceived naturalness, speaker similarity, or overall speech quality.
Actual performance can vary depending on:
- text length
- vocabulary
- names and rare words
- pronunciation
- Hausa dialect
- speaker embedding
- punctuation
- numerical expressions
- inference environment
Quick Start
Installation
Clone or download this repository and install the demo dependencies:
pip install -r demo/requirements.txt
PyTorch should be installed according to your hardware and CUDA environment.
Basic Inference
python demo/inference.py \
--model Afrilab/HanwaTTS \
--speaker afr_3572 \
--text "Assalamu alaikum, ya ya kuke?" \
--output output.wav
The generated audio is written as a 16 kHz mono WAV file.
Speaker Embeddings
The repository supports two speaker embedding profiles for experimentation.
Speaker Profile 1
afr_3572
Run:
python demo/inference.py \
--model Afrilab/HanwaTTS \
--speaker afr_3572 \
--text "Assalamu alaikum, ya ya kuke?" \
--output afr_3572.wav
Speaker Profile 2
epitran_num
Run:
python demo/inference.py \
--model Afrilab/HanwaTTS \
--speaker epitran_num \
--text "Assalamu alaikum, ya ya kuke?" \
--output epitran_num.wav
Both embeddings have the expected SpeechT5 speaker embedding shape:
[1, 512]
The two embeddings are different speaker representations and may produce different voice characteristics during synthesis.
Example Audio
A generated Hausa sample is included in:
examples/hausa_sample_01.wav
The sample demonstrates inference using HanwaTTS with a Hausa sentence.
Example Hausa Text
Additional example sentences are available in:
examples/sample_texts.txt
They include conversational Hausa and examples intended for testing different linguistic patterns.
Using a Local Model
The inference script also supports a local model directory.
For example:
python demo/inference.py \
--model . \
--speaker afr_3572 \
--text "Assalamu alaikum, sunana Abdulmalik." \
--output local_test.wav
GPU Inference
If CUDA is available, the demo automatically uses the GPU.
To explicitly force CPU inference:
python demo/inference.py \
--model Afrilab/HanwaTTS \
--speaker afr_3572 \
--text "Ina son koyon fasahar kere-kere ta wucin gadi." \
--output cpu_output.wav \
--cpu
GPU inference is recommended for faster generation.
Vocoder
HanwaTTS uses the SpeechT5 HiFi-GAN vocoder:
microsoft/speecht5_hifigan
The vocoder is loaded separately during inference.
You can provide another compatible vocoder with:
--vocoder <vocoder-name-or-local-path>
Limitations
HanwaTTS is a low-resource Hausa TTS model and has several limitations.
Dataset size
The model was trained using 3,572 paired samples. This is substantially smaller than datasets commonly used for high-resource speech synthesis.
Dialect coverage
The training data may not represent the full range of Hausa dialects, accents, and regional pronunciation patterns.
Pronunciation
Performance may vary for:
- uncommon Hausa words
- names
- foreign words
- abbreviations
- numbers
- dates
- monetary expressions
- unusual punctuation
- code-switching
Voice characteristics
url: https://huggingface.co/Afrilab/HanwaTTS/commit/bd337e7705e49b9f86be557b664cbf07354241f6
(tts_project) trainee1@asus-System-Product-Name:/hf_models/hausa-speecht5-tts$ hf models info Afrilab/HanwaTTS
{
"id": "Afrilab/HanwaTTS",
"author": "Afrilab",
"card_data": {
"base_model": [
"microsoft/speecht5_tts"
],
"language": [
"ha"
],
"library_name": "transformers",
"license": "mit",
"pipeline_tag": "text-to-speech",
"tags": [
"hausa",
"hausa-tts",
"text-to-speech",
"speech-synthesis",
"speecht5",
"low-resource-language",
"african-languages"
]
},
"config": {
"architectures": [
"SpeechT5ForTextToSpeech"
],
"model_type": "speecht5",
"tokenizer_config": {
"bos_token": "/hf_models/hausa-speecht5-tts$ ",
"eos_token": "",
"mask_token": "
The provided speaker embeddings represent particular speaker characteristics. They should not be interpreted as representing every Hausa speaker.
Evaluation limitations
The reported WER and CER are automatic evaluation metrics. They do not replace human evaluation of:
- naturalness
- pronunciation
- intelligibility
- prosody
- speaker similarity
- expressiveness
Ethical Considerations
Speech synthesis technology can be used to generate convincing synthetic speech.
Users should:
- obtain appropriate consent when using identifiable speaker representations
- disclose synthetic or generated speech when appropriate
- avoid impersonation and deceptive use
- avoid presenting generated speech as an authentic recording
- respect applicable privacy, copyright, and data-protection requirements
The model should not be used to create deceptive recordings of individuals without appropriate authorization.
Data and Speaker Rights
The training recordings used to develop HanwaTTS were recorded by Afrilab AI Hub.
The original training recordings are not included in this repository.
The model license does not automatically grant rights to the underlying recordings, speaker identities, or other source data.
Speaker embeddings should only be redistributed or used where the necessary authorization and rights have been obtained.
Public Speaker Embeddings
Two speaker embeddings are included in the repository for public inference and demonstration:
| Profile | File | Shape |
|---|---|---|
afr_3572 |
embeddings/afr_3572_speaker_embedding.pt |
[1, 512] |
epitran_num |
embeddings/epitran_num_speaker_embedding.pt |
[1, 512] |
These speaker embeddings are intentionally distributed as public HanwaTTS project assets and are authorized for redistribution as part of the project.
The original training recordings are not included in the repository.
The embeddings can be selected directly through the demo:
python demo/inference.py \
--model Afrilab/HanwaTTS \
--speaker afr_3572 \
--text "Assalamu alaikum, ya ya kuke?" \
--output output.wav
or:
python demo/inference.py \
--model Afrilab/HanwaTTS \
--speaker epitran_num \
--text "Assalamu alaikum, ya ya kuke?" \
--output output.wav
Users should not use the generated speech for impersonation, fraud, deception, or other harmful purposes.
License
The HanwaTTS model and repository are released under the MIT License, subject to the rights and licensing terms of the underlying components.
The base SpeechT5 model used for this work is:
microsoft/speecht5_tts
The licensing status of the model should be considered separately from rights associated with the training recordings and speaker representations.
See LICENSE for the repository license.
Citation
If you use HanwaTTS in research or software, please cite this repository and the original SpeechT5 work.
SpeechT5
@article{ao2021speecht5,
title={SpeechT5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing},
author={Ao, Junyi and Wang, Rui and Zhou, Long and Wei, Shiliang and Ren, Shuo and Peng, Yu and others},
journal={arXiv preprint arXiv:2110.07205},
year={2021}
}
HanwaTTS
@misc{hanwatts,
title={HanwaTTS: Hausa Text-to-Speech Model},
author={Afrilab AI Hub},
year={2026},
publisher={Hugging Face},
url={https://huggingface.co/Afrilab/HanwaTTS}
}
Acknowledgements
HanwaTTS builds on the SpeechT5 architecture and pretrained model developed by Microsoft Research and contributors.
We acknowledge the contribution of Afrilab AI Hub's Hausa speech data collection and research efforts toward developing speech technology for Hausa.
Disclaimer
HanwaTTS is provided for research and development purposes. Generated speech may contain pronunciation, timing, prosody, or other synthesis errors.
Users are responsible for evaluating generated output and ensuring that their use of the model complies with applicable laws, licenses, permissions, and ethical requirements.
- Downloads last month
- 2
Model tree for Afrilab/HanwaTTS
Base model
microsoft/speecht5_tts