Text-to-Speech
Transformers
Safetensors
Kabyle
matoub
feature-extraction
kabyle
taqbaylit
berber
amazigh
speech-synthesis
styletts2
low-resource
custom_code
Instructions to use agbalu/Matoub-82M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use agbalu/Matoub-82M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="agbalu/Matoub-82M", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("agbalu/Matoub-82M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update model card with standalone usage instructions
Browse files
README.md
CHANGED
|
@@ -63,19 +63,29 @@ This preview will remain permanently published. The two future production models
|
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
```bash
|
| 67 |
-
|
| 68 |
```
|
| 69 |
|
| 70 |
The synthesis pipeline:
|
| 71 |
|
| 72 |
-
1. **G2P** --
|
| 73 |
2. **Style extraction** -- a reference clip from the training voice is encoded by `style_encoder` and `predictor_encoder` to produce a 256-dim speaker style vector.
|
| 74 |
3. **Duration and pitch prediction** -- `bert` (PL-BERT, 12 layers), `bert_encoder`, `predictor`, and `predictor_encoder` predict phoneme durations and F0 contours from the token sequence and style vector.
|
| 75 |
4. **Waveform decoding** -- the HiFi-GAN `decoder` renders 24 kHz mono audio.
|
| 76 |
|
| 77 |
-
Output is 24 kHz mono WAV. Pass `--alpha 0.0 --beta 0.0` explicitly; any positive `beta` produces noise from the untrained diffusion sampler.
|
| 78 |
-
|
| 79 |
## Architecture
|
| 80 |
|
| 81 |
Matoub-82M is a StyleTTS2 model initialised from Kokoro-82M weights and fine-tuned in two stages:
|
|
|
|
| 63 |
|
| 64 |
## Usage
|
| 65 |
|
| 66 |
+
```python
|
| 67 |
+
# Standalone Python inference with the shipped inference.py:
|
| 68 |
+
# pip install torch torchaudio librosa soundfile huggingface_hub
|
| 69 |
+
|
| 70 |
+
from inference import MatoubTTS
|
| 71 |
+
|
| 72 |
+
tts = MatoubTTS.load()
|
| 73 |
+
tts.synthesise("Azul fell-awen, amek i telliḍ taṣebḥit-a?", "output.wav")
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
Or from the command line:
|
| 77 |
+
|
| 78 |
```bash
|
| 79 |
+
python inference.py --text "Azul fell-awen, amek i telliḍ taṣebḥit-a?" --out output.wav
|
| 80 |
```
|
| 81 |
|
| 82 |
The synthesis pipeline:
|
| 83 |
|
| 84 |
+
1. **G2P** -- converts Kabyle Latin text to IPA, folding affricate tie-bar sequences (`t͡ʃ` -> `ʧ`, `d͡ʒ` -> `ʤ`) to the symbols in Kokoro's token table.
|
| 85 |
2. **Style extraction** -- a reference clip from the training voice is encoded by `style_encoder` and `predictor_encoder` to produce a 256-dim speaker style vector.
|
| 86 |
3. **Duration and pitch prediction** -- `bert` (PL-BERT, 12 layers), `bert_encoder`, `predictor`, and `predictor_encoder` predict phoneme durations and F0 contours from the token sequence and style vector.
|
| 87 |
4. **Waveform decoding** -- the HiFi-GAN `decoder` renders 24 kHz mono audio.
|
| 88 |
|
|
|
|
|
|
|
| 89 |
## Architecture
|
| 90 |
|
| 91 |
Matoub-82M is a StyleTTS2 model initialised from Kokoro-82M weights and fine-tuned in two stages:
|