Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,113 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- text-to-speech
|
| 7 |
+
- tts
|
| 8 |
+
- matcha-tts
|
| 9 |
+
- flow-matching
|
| 10 |
+
- tflite
|
| 11 |
+
- onnx
|
| 12 |
+
- audio
|
| 13 |
+
- on-device
|
| 14 |
+
datasets:
|
| 15 |
+
- ljspeech
|
| 16 |
+
metrics:
|
| 17 |
+
- loss
|
| 18 |
+
pipeline_tag: text-to-speech
|
| 19 |
---
|
| 20 |
+
|
| 21 |
+
# Sonora (Phase 0)
|
| 22 |
+
|
| 23 |
+
**Sonora** is a lightweight, non-autoregressive text-to-speech (TTS) model designed for real-time, on-device, and resource-constrained environments.
|
| 24 |
+
|
| 25 |
+
This model card covers the **Phase 0 baseline** fine-tune, which is built on the **Matcha-TTS** architecture and fine-tuned on the single-speaker LJSpeech dataset. The final model graph embeds the **HiFi-GAN vocoder** (`hifigan_T2_v1`) to execute full end-to-end waveform synthesis directly in a single forward pass (Text IDs $\rightarrow$ PCM Audio).
|
| 26 |
+
|
| 27 |
+
* **Voice Engine Integration:** Deployed inside **Project Prosodia** (`ProsodiaActor`)
|
| 28 |
+
* **Underlying Architecture:** Optimal Transport Conditional Flow Matching (OT-CFM)
|
| 29 |
+
* **Parameter Count:** ~18.2 Million
|
| 30 |
+
* **Sample Rate:** 22,050 Hz (mono)
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## Model Details
|
| 35 |
+
|
| 36 |
+
* **Developed by:** Artificial Humanity
|
| 37 |
+
* **Model Type:** Acoustic Flow-Matching Model + HiFi-GAN Vocoder (end-to-end graph)
|
| 38 |
+
* **Language(s):** English (en)
|
| 39 |
+
* **License:** MIT
|
| 40 |
+
* **Base Checkpoint:** `matcha_ljspeech.ckpt` (v1.0)
|
| 41 |
+
* **Parent Model Paper:** [Matcha-TTS: A Fast CFM Text-to-Speech Model (Mehta et al., 2024)](https://arxiv.org/abs/2309.03199)
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## Active Formats
|
| 46 |
+
|
| 47 |
+
The model is distributed in multiple formats for execution on different hardware backends:
|
| 48 |
+
|
| 49 |
+
1. **`checkpoint_epoch=199_e2e_float16.tflite`** (89.8 MB) — **Recommended for on-device deployment.** Quantized to Float16 for accelerated execution on mobile/edge NPUs and GPUs via LiteRT (TensorFlow Lite).
|
| 50 |
+
2. **`checkpoint_epoch=199_e2e_float32.tflite`** (178.2 MB) — High-precision Float32 model for desktop CPU/GPU evaluation.
|
| 51 |
+
3. **`checkpoint_epoch=199_e2e.onnx`** (178.2 MB) — Standalone ONNX graph for server-side inference or platform debugging.
|
| 52 |
+
|
| 53 |
+
---
|
| 54 |
+
|
| 55 |
+
## Training Environment & Hardware
|
| 56 |
+
|
| 57 |
+
The model was trained locally on the `ai-lab-0` workstation using a containerized AMD ROCm configuration:
|
| 58 |
+
|
| 59 |
+
* **Host CPU:** AMD Ryzen AI Max+ 395 (16 Cores, 32 Threads, Zen 5)
|
| 60 |
+
* **Host GPU:** AMD Radeon 8060S Graphics (RDNA 3.5, 40 Compute Units, Target: `gfx1151`)
|
| 61 |
+
* **Allocatable VRAM:** 112 GB Unified LPDDR5X (shared memory pool)
|
| 62 |
+
* **Operating System:** Ubuntu 26.04 LTS (Kernel `7.0.0-27-generic`)
|
| 63 |
+
* **Container Environment:** `rocm/pytorch:latest` running PyTorch 2.x + ROCm 7.2.4
|
| 64 |
+
* **Optimization:** 16-bit Automatic Mixed Precision (AMP), batch size 32, shared memory (`--ipc=host`, `--shm-size 16G`).
|
| 65 |
+
|
| 66 |
+
---
|
| 67 |
+
|
| 68 |
+
## Training History & Hyperparameters
|
| 69 |
+
|
| 70 |
+
* **Total Epochs Trained:** 260 (over 101,000 steps)
|
| 71 |
+
* **Selected Checkpoint:** Epoch 199 (step ~82,000) where validation loss converged and stabilized.
|
| 72 |
+
* **Loss Function:** Joint Flow-Matching loss, duration prediction loss, and monotonic alignment prior loss.
|
| 73 |
+
* **Troubleshooting Fixes Applied:**
|
| 74 |
+
* **Audio Decoding:** Replaced `torchaudio.load()` with `soundfile.read()` in the data pipeline to bypass CUDA-exclusive shared library dependencies (`torchcodec` decoding failures) inside the ROCm container.
|
| 75 |
+
* **Matplotlib Compatibility:** Patched validation figure logging to use `np.asarray(fig.canvas.buffer_rgba())[:, :, :3]`, avoiding the deprecated and removed `tostring_rgb()` method under Matplotlib 3.9+.
|
| 76 |
+
|
| 77 |
+
---
|
| 78 |
+
|
| 79 |
+
## Intended Uses & Limitations
|
| 80 |
+
|
| 81 |
+
### Intended Use
|
| 82 |
+
* **On-Device Narration:** Real-time text-to-speech synthesis directly on mobile devices (iOS/Android) and desktop clients without sending telemetry data to external cloud APIs.
|
| 83 |
+
* **Emotion & Directability Scaffolding:** Serves as the foundation for the Phase 1 directable voice actor, which will add Valence/Arousal/Tension (VAT) conditioning controls.
|
| 84 |
+
|
| 85 |
+
### Limitations
|
| 86 |
+
* **LJSpeech Speaker Profile:** The model is currently trained on a single female narrator and lacks voice variety or pitch modulation. Multi-speaker voice blending and casting grids are planned for the next training iteration (using Expresso and LibriTTS-R).
|
| 87 |
+
* **Phoneme Representation:** Requires an external G2P (Grapheme-to-Phoneme) converter to translate raw text into phoneme ID sequences before model execution. Project Prosodia handles this natively via its built-in CMUdict lexicon Rust crate (`crates/actor/src/g2p.rs`).
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## How to Get Started
|
| 92 |
+
|
| 93 |
+
### Loading the Model in Project Prosodia (Rust)
|
| 94 |
+
The compiled model weights are loaded dynamically by the `StageCoordinator` through the TFLite runtime C-API.
|
| 95 |
+
|
| 96 |
+
To use this model locally:
|
| 97 |
+
1. Download `checkpoint_epoch=199_e2e_float16.tflite`.
|
| 98 |
+
2. Rename the file to `styletts2_lite.tflite` (or update your environment configs to load the custom filename).
|
| 99 |
+
3. Place it in your shared `Models/` directory.
|
| 100 |
+
4. Run your application:
|
| 101 |
+
```bash
|
| 102 |
+
cargo run --package tuner-app
|
| 103 |
+
```
|
| 104 |
+
|
| 105 |
+
### Input/Output Tensor Node Contract
|
| 106 |
+
The model graph matches the following tensor specifications:
|
| 107 |
+
* **Inputs:**
|
| 108 |
+
* `x`: token IDs representing phonemes (Shape: `[1, token_count]`, `i32` / `int64`).
|
| 109 |
+
* `x_lengths`: length of the token sequence (Shape: `[1]`, `i32` / `int64`).
|
| 110 |
+
* `scales`: scale parameters (Shape: `[2]`, `f32` containing `[temperature, length_scale]`).
|
| 111 |
+
* **Outputs:**
|
| 112 |
+
* `wav`: Raw PCM audio waveform samples (Shape: `[1, audio_length]`, `f32` mono 22.05 kHz).
|
| 113 |
+
* `wav_lengths`: The total count of generated audio samples (Shape: `[1]`, `i32` / `int64`).
|