ainouche-abderahmane commited on
Commit
cc349f2
·
verified ·
1 Parent(s): 28c2d7c

Update model card with standalone usage instructions

Browse files
Files changed (1) hide show
  1. README.md +14 -4
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
- make infer-matoub TEXT="Azul fell-awen, amek i telliḍ taṣebḥit-a?"
68
  ```
69
 
70
  The synthesis pipeline:
71
 
72
- 1. **G2P** -- `agbalu.tts.g2p.phonemize` converts Kabyle Latin text to IPA. `agbalu.tts.kokoro.fold` rewrites affricate tie-bar sequences (`t͡ʃ` -> `ʧ`, `d͡ʒ` -> `ʤ`) to the symbols already in Kokoro's token table.
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: