Upload folder using huggingface_hub
#1
by Mwau - opened
- README.md +80 -0
- added_tokens.json +3 -0
- config.json +109 -0
- model.safetensors +3 -0
- preprocessor_config.json +11 -0
- special_tokens_map.json +16 -0
- tokenizer_config.json +34 -0
- vocab.json +41 -0
README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- sw
|
| 4 |
+
license: cc-by-nc-4.0
|
| 5 |
+
base_model: facebook/mms-tts-swh
|
| 6 |
+
tags:
|
| 7 |
+
- text-to-speech
|
| 8 |
+
- tts
|
| 9 |
+
- vits
|
| 10 |
+
- swahili
|
| 11 |
+
- mms
|
| 12 |
+
datasets:
|
| 13 |
+
- google/WaxalNLP
|
| 14 |
+
pipeline_tag: text-to-speech
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# waxal_swahili-tts-mms
|
| 18 |
+
|
| 19 |
+
A Swahili text-to-speech model, finetuned from Meta's [MMS-TTS Swahili](https://huggingface.co/facebook/mms-tts-swh) checkpoint on the `swa_tts` split of [google/WaxalNLP](https://huggingface.co/datasets/google/WaxalNLP), using the [VITS finetuning recipe](https://github.com/ylacombe/finetune-hf-vits) from `ylacombe/finetune-hf-vits`.
|
| 20 |
+
|
| 21 |
+
> **⚠️ Early checkpoint.** This model is saved from step 4,500 of a planned 20,200-step (200-epoch) training run — roughly 22% through. Training was interrupted by free-tier Google Colab resource limits and is being continued on different hardware. Expect rough prosody and occasional mispronunciations. This card will be updated as training progresses.
|
| 22 |
+
|
| 23 |
+
## Model details
|
| 24 |
+
|
| 25 |
+
- **Base model:** `facebook/mms-tts-swh` (Meta's Massively Multilingual Speech TTS, Swahili)
|
| 26 |
+
- **Architecture:** VITS (single-speaker)
|
| 27 |
+
- **Training data:** [google/WaxalNLP](https://huggingface.co/datasets/google/WaxalNLP), `swa_tts` config — 1,387 train utterances (805 after duration/length filtering), single Swahili speaker, 16kHz audio, sourced via the Loud & Clear initiative.
|
| 28 |
+
- **Training checkpoint:** step 4,500 / 20,200 planned steps (~22 epochs of ~805 examples)
|
| 29 |
+
- **Sample rate:** 16,000 Hz
|
| 30 |
+
- **Language:** Swahili (`swh` / ISO 639-3)
|
| 31 |
+
|
| 32 |
+
## Training configuration
|
| 33 |
+
|
| 34 |
+
| Setting | Value |
|
| 35 |
+
|---|---|
|
| 36 |
+
| Learning rate | 2e-5 |
|
| 37 |
+
| Batch size | 8 |
|
| 38 |
+
| Precision | fp16 |
|
| 39 |
+
| Max clip duration | 20s |
|
| 40 |
+
| Min clip duration | 0.5s |
|
| 41 |
+
| Loss weights | mel=35, kl=1.5, disc=3, gen/fmaps/duration=1 |
|
| 42 |
+
|
| 43 |
+
Training used the `finetune-hf-vits` recipe with `transformers==4.35.1`, `datasets==2.14.7`, `accelerate==0.24.1`, `numpy<2.0` (this specific combination was required to avoid dependency-incompatibility crashes on Colab).
|
| 44 |
+
|
| 45 |
+
## Usage
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
import numpy as np
|
| 49 |
+
from transformers import pipeline
|
| 50 |
+
import scipy.io.wavfile
|
| 51 |
+
|
| 52 |
+
synthesiser = pipeline("text-to-speech", model="Mwau/waxal_swahili-tts-mms")
|
| 53 |
+
speech = synthesiser("Habari yako, karibu Kenya.")
|
| 54 |
+
|
| 55 |
+
audio = np.squeeze(speech["audio"]) # squeeze extra dims before saving/playing
|
| 56 |
+
scipy.io.wavfile.write("output.wav", rate=speech["sampling_rate"], data=audio)
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
Verified loading cleanly with `transformers` `pipeline("text-to-speech", ...)` — no missing/unexpected weight warnings on load.
|
| 60 |
+
|
| 61 |
+
## Intended use
|
| 62 |
+
|
| 63 |
+
Research and experimentation with Swahili TTS, particularly cross-lingual/low-resource TTS transfer techniques. Not yet suitable for production or user-facing applications given the early training stage.
|
| 64 |
+
|
| 65 |
+
## Limitations
|
| 66 |
+
|
| 67 |
+
- **Undertrained**: only ~22 epochs completed of a 200-epoch plan; expect unstable prosody, occasional artifacts, and inconsistent pacing.
|
| 68 |
+
- **Single speaker, single dataset**: trained on one speaker's recordings from one dataset; may not generalize well to varied Swahili dialects, accents, or speaking styles.
|
| 69 |
+
- **No formal evaluation yet**: no MOS, WER, or MCD scores have been computed for this checkpoint. Qualitative spot-checks against WAXAL's held-out `test` split suggest intelligible but rough output.
|
| 70 |
+
- **Small dataset**: ~800 training utterances after filtering is a small corpus for TTS; may overfit to the training speaker's specific vocal characteristics.
|
| 71 |
+
|
| 72 |
+
## License
|
| 73 |
+
|
| 74 |
+
This model is derived from `facebook/mms-tts-swh`, which is released under **CC-BY-NC-4.0** (non-commercial). This finetuned model inherits that license. The `swa_tts` training data is released under CC-BY-SA-4.0.
|
| 75 |
+
|
| 76 |
+
## Acknowledgements
|
| 77 |
+
|
| 78 |
+
- [Meta MMS](https://huggingface.co/facebook/mms-tts-swh) for the base checkpoint
|
| 79 |
+
- [WAXAL / google/WaxalNLP](https://huggingface.co/datasets/google/WaxalNLP) for the training data
|
| 80 |
+
- [ylacombe/finetune-hf-vits](https://github.com/ylacombe/finetune-hf-vits) for the finetuning recipe
|
added_tokens.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"<unk>": 39
|
| 3 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "Mwau/mms-tts-swh-with-discriminator",
|
| 3 |
+
"activation_dropout": 0.1,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"VitsModel"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.1,
|
| 8 |
+
"depth_separable_channels": 2,
|
| 9 |
+
"depth_separable_num_layers": 3,
|
| 10 |
+
"discriminator_kernel_size": 5,
|
| 11 |
+
"discriminator_period_channels": [
|
| 12 |
+
1,
|
| 13 |
+
32,
|
| 14 |
+
128,
|
| 15 |
+
512,
|
| 16 |
+
1024
|
| 17 |
+
],
|
| 18 |
+
"discriminator_periods": [
|
| 19 |
+
2,
|
| 20 |
+
3,
|
| 21 |
+
5,
|
| 22 |
+
7,
|
| 23 |
+
11
|
| 24 |
+
],
|
| 25 |
+
"discriminator_scale_channels": [
|
| 26 |
+
1,
|
| 27 |
+
16,
|
| 28 |
+
64,
|
| 29 |
+
256,
|
| 30 |
+
1024
|
| 31 |
+
],
|
| 32 |
+
"discriminator_stride": 3,
|
| 33 |
+
"dtype": "float32",
|
| 34 |
+
"duration_predictor_dropout": 0.5,
|
| 35 |
+
"duration_predictor_filter_channels": 256,
|
| 36 |
+
"duration_predictor_flow_bins": 10,
|
| 37 |
+
"duration_predictor_kernel_size": 3,
|
| 38 |
+
"duration_predictor_num_flows": 4,
|
| 39 |
+
"duration_predictor_tail_bound": 5.0,
|
| 40 |
+
"ffn_dim": 768,
|
| 41 |
+
"ffn_kernel_size": 3,
|
| 42 |
+
"flow_size": 192,
|
| 43 |
+
"hidden_act": "relu",
|
| 44 |
+
"hidden_dropout": 0.1,
|
| 45 |
+
"hidden_size": 192,
|
| 46 |
+
"hop_length": 256,
|
| 47 |
+
"initializer_range": 0.02,
|
| 48 |
+
"layer_norm_eps": 1e-05,
|
| 49 |
+
"layerdrop": 0.1,
|
| 50 |
+
"leaky_relu_slope": 0.1,
|
| 51 |
+
"model_type": "vits",
|
| 52 |
+
"noise_scale": 0.667,
|
| 53 |
+
"noise_scale_duration": 0.8,
|
| 54 |
+
"num_attention_heads": 2,
|
| 55 |
+
"num_hidden_layers": 6,
|
| 56 |
+
"num_speakers": 1,
|
| 57 |
+
"posterior_encoder_num_wavenet_layers": 16,
|
| 58 |
+
"prior_encoder_num_flows": 4,
|
| 59 |
+
"prior_encoder_num_wavenet_layers": 4,
|
| 60 |
+
"resblock_dilation_sizes": [
|
| 61 |
+
[
|
| 62 |
+
1,
|
| 63 |
+
3,
|
| 64 |
+
5
|
| 65 |
+
],
|
| 66 |
+
[
|
| 67 |
+
1,
|
| 68 |
+
3,
|
| 69 |
+
5
|
| 70 |
+
],
|
| 71 |
+
[
|
| 72 |
+
1,
|
| 73 |
+
3,
|
| 74 |
+
5
|
| 75 |
+
]
|
| 76 |
+
],
|
| 77 |
+
"resblock_kernel_sizes": [
|
| 78 |
+
3,
|
| 79 |
+
7,
|
| 80 |
+
11
|
| 81 |
+
],
|
| 82 |
+
"sampling_rate": 16000,
|
| 83 |
+
"segment_size": 8192,
|
| 84 |
+
"speaker_embedding_size": 0,
|
| 85 |
+
"speaking_rate": 1.0,
|
| 86 |
+
"spectrogram_bins": 513,
|
| 87 |
+
"torch_dtype": "float32",
|
| 88 |
+
"transformers_version": "4.35.1",
|
| 89 |
+
"upsample_initial_channel": 512,
|
| 90 |
+
"upsample_kernel_sizes": [
|
| 91 |
+
16,
|
| 92 |
+
16,
|
| 93 |
+
4,
|
| 94 |
+
4
|
| 95 |
+
],
|
| 96 |
+
"upsample_rates": [
|
| 97 |
+
8,
|
| 98 |
+
8,
|
| 99 |
+
2,
|
| 100 |
+
2
|
| 101 |
+
],
|
| 102 |
+
"use_bias": true,
|
| 103 |
+
"use_stochastic_duration_prediction": true,
|
| 104 |
+
"vocab_size": 39,
|
| 105 |
+
"wavenet_dilation_rate": 1,
|
| 106 |
+
"wavenet_dropout": 0.0,
|
| 107 |
+
"wavenet_kernel_size": 5,
|
| 108 |
+
"window_size": 4
|
| 109 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0493b6cf3bfe435095a2f53685be564753f981cade1a57b7e7955a485d45a4ef
|
| 3 |
+
size 145231480
|
preprocessor_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"feature_extractor_type": "VitsFeatureExtractor",
|
| 3 |
+
"feature_size": 80,
|
| 4 |
+
"hop_length": 256,
|
| 5 |
+
"max_wav_value": 32768.0,
|
| 6 |
+
"n_fft": 1024,
|
| 7 |
+
"padding_side": "right",
|
| 8 |
+
"padding_value": 0.0,
|
| 9 |
+
"return_attention_mask": false,
|
| 10 |
+
"sampling_rate": 16000
|
| 11 |
+
}
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"pad_token": {
|
| 3 |
+
"content": "2",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"unk_token": {
|
| 10 |
+
"content": "<unk>",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
}
|
| 16 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_blank": true,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"0": {
|
| 5 |
+
"content": "2",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"39": {
|
| 13 |
+
"content": "<unk>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
}
|
| 20 |
+
},
|
| 21 |
+
"backend": "custom",
|
| 22 |
+
"clean_up_tokenization_spaces": true,
|
| 23 |
+
"is_local": false,
|
| 24 |
+
"is_uroman": false,
|
| 25 |
+
"language": "swh",
|
| 26 |
+
"local_files_only": false,
|
| 27 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 28 |
+
"normalize": true,
|
| 29 |
+
"pad_token": "2",
|
| 30 |
+
"phonemize": false,
|
| 31 |
+
"tokenizer_class": "VitsTokenizer",
|
| 32 |
+
"unk_token": "<unk>",
|
| 33 |
+
"verbose": false
|
| 34 |
+
}
|
vocab.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
" ": 34,
|
| 3 |
+
"'": 36,
|
| 4 |
+
"-": 9,
|
| 5 |
+
"0": 13,
|
| 6 |
+
"1": 23,
|
| 7 |
+
"2": 0,
|
| 8 |
+
"3": 24,
|
| 9 |
+
"4": 18,
|
| 10 |
+
"5": 31,
|
| 11 |
+
"6": 27,
|
| 12 |
+
"7": 17,
|
| 13 |
+
"8": 7,
|
| 14 |
+
"_": 38,
|
| 15 |
+
"a": 29,
|
| 16 |
+
"b": 19,
|
| 17 |
+
"c": 8,
|
| 18 |
+
"d": 2,
|
| 19 |
+
"e": 11,
|
| 20 |
+
"f": 20,
|
| 21 |
+
"g": 14,
|
| 22 |
+
"h": 37,
|
| 23 |
+
"i": 22,
|
| 24 |
+
"j": 4,
|
| 25 |
+
"k": 10,
|
| 26 |
+
"l": 5,
|
| 27 |
+
"m": 1,
|
| 28 |
+
"n": 32,
|
| 29 |
+
"o": 25,
|
| 30 |
+
"p": 12,
|
| 31 |
+
"q": 33,
|
| 32 |
+
"r": 3,
|
| 33 |
+
"s": 6,
|
| 34 |
+
"t": 26,
|
| 35 |
+
"u": 15,
|
| 36 |
+
"v": 21,
|
| 37 |
+
"w": 16,
|
| 38 |
+
"y": 30,
|
| 39 |
+
"z": 28,
|
| 40 |
+
"ʼ": 35
|
| 41 |
+
}
|