Instructions to use webmp3/Sakura-sanoTTS-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Piper
How to use webmp3/Sakura-sanoTTS-ONNX with Piper:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update documentation, clean LICENSE/NOTICE, add root config.json manifest, and sanitize quantization notes
Browse files- LICENSE +0 -17
- NOTICE.md +9 -0
- README.md +294 -219
- SHA256SUMS +6 -4
- config.json +19 -0
- docs/QUALITY.md +28 -29
- runtime/sanotts_onnx.py +13 -0
LICENSE
CHANGED
|
@@ -1,20 +1,3 @@
|
|
| 1 |
-
Sakura-sanoTTS-ONNX is licensed under the GNU General Public License v3.0 (GPL-3.0).
|
| 2 |
-
|
| 3 |
-
Upstream sanoTTS project:
|
| 4 |
-
Author: Ampixa
|
| 5 |
-
Repository: https://huggingface.co/ampixa/sanoTTS
|
| 6 |
-
License: GNU General Public License v3.0 (GPL-3.0)
|
| 7 |
-
Copyright (C) 2026 Ampixa
|
| 8 |
-
|
| 9 |
-
ONNX Export & Quantization:
|
| 10 |
-
Sakura / webmp3
|
| 11 |
-
Repository: https://huggingface.co/webmp3/Sakura-sanoTTS-ONNX
|
| 12 |
-
Copyright (C) 2026 webmp3
|
| 13 |
-
|
| 14 |
-
==============================================================================
|
| 15 |
-
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
|
| 16 |
-
==============================================================================
|
| 17 |
-
|
| 18 |
GNU GENERAL PUBLIC LICENSE
|
| 19 |
Version 3, 29 June 2007
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
GNU GENERAL PUBLIC LICENSE
|
| 2 |
Version 3, 29 June 2007
|
| 3 |
|
NOTICE.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Attribution & Notice
|
| 2 |
+
|
| 3 |
+
Sakura-sanoTTS-ONNX is an independent ONNX/ONNX Runtime conversion and quantized derivative of ampixa/sanoTTS.
|
| 4 |
+
|
| 5 |
+
- **Original project**: https://huggingface.co/ampixa/sanoTTS
|
| 6 |
+
- **Original authors**: Ampixa
|
| 7 |
+
- **Derivative conversion and release**: webmp3 / Sakura
|
| 8 |
+
|
| 9 |
+
This project is not an official Ampixa release.
|
README.md
CHANGED
|
@@ -1,219 +1,294 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: gpl-3.0
|
| 3 |
-
language:
|
| 4 |
-
- en
|
| 5 |
-
- de
|
| 6 |
-
- es
|
| 7 |
-
- fr
|
| 8 |
-
- it
|
| 9 |
-
- pt
|
| 10 |
-
- ru
|
| 11 |
-
- vi
|
| 12 |
-
- id
|
| 13 |
-
pipeline_tag: text-to-speech
|
| 14 |
-
tags:
|
| 15 |
-
- text-to-speech
|
| 16 |
-
- tts
|
| 17 |
-
- speech
|
| 18 |
-
- onnx
|
| 19 |
-
- onnxruntime
|
| 20 |
-
- cpu
|
| 21 |
-
- quantization
|
| 22 |
-
- int8
|
| 23 |
-
- fp32
|
| 24 |
-
- audio
|
| 25 |
-
- piper
|
| 26 |
-
- voice
|
| 27 |
-
base_model: ampixa/sanoTTS
|
| 28 |
-
base_model_relation: quantized
|
| 29 |
-
library_name: onnxruntime
|
| 30 |
-
---
|
| 31 |
-
|
| 32 |
-
# Sakura-sanoTTS-ONNX (CPU-Optimized)
|
| 33 |
-
|
| 34 |
-
[](https://huggingface.co/webmp3/Sakura-sanoTTS-ONNX)
|
| 35 |
-
[](LICENSE)
|
| 36 |
-
[](https://onnxruntime.ai)
|
| 37 |
-
|
| 38 |
-
High-fidelity, CPU-optimized, and reproducible ONNX and INT8 release of **sanoTTS** ([ampixa/sanoTTS](https://huggingface.co/ampixa/sanoTTS)).
|
| 39 |
-
|
| 40 |
-
Target platform: **Windows / Linux x86-64 CPU & ARM64**, running via the standard **ONNX Runtime CPU Execution Provider**. No GPU or CUDA required.
|
| 41 |
-
|
| 42 |
-
---
|
| 43 |
-
|
| 44 |
-
## 1.
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
`
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
--
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
```
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
```
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
```
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
#
|
| 172 |
-
tts
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
```
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
│
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
- **
|
| 218 |
-
- **
|
| 219 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gpl-3.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- de
|
| 6 |
+
- es
|
| 7 |
+
- fr
|
| 8 |
+
- it
|
| 9 |
+
- pt
|
| 10 |
+
- ru
|
| 11 |
+
- vi
|
| 12 |
+
- id
|
| 13 |
+
pipeline_tag: text-to-speech
|
| 14 |
+
tags:
|
| 15 |
+
- text-to-speech
|
| 16 |
+
- tts
|
| 17 |
+
- speech
|
| 18 |
+
- onnx
|
| 19 |
+
- onnxruntime
|
| 20 |
+
- cpu
|
| 21 |
+
- quantization
|
| 22 |
+
- int8
|
| 23 |
+
- fp32
|
| 24 |
+
- audio
|
| 25 |
+
- piper
|
| 26 |
+
- voice
|
| 27 |
+
base_model: ampixa/sanoTTS
|
| 28 |
+
base_model_relation: quantized
|
| 29 |
+
library_name: onnxruntime
|
| 30 |
+
---
|
| 31 |
+
|
| 32 |
+
# Sakura-sanoTTS-ONNX (CPU-Optimized)
|
| 33 |
+
|
| 34 |
+
[](https://huggingface.co/webmp3/Sakura-sanoTTS-ONNX)
|
| 35 |
+
[](LICENSE)
|
| 36 |
+
[](https://onnxruntime.ai)
|
| 37 |
+
|
| 38 |
+
High-fidelity, CPU-optimized, and reproducible ONNX and INT8 release of **sanoTTS** ([ampixa/sanoTTS](https://huggingface.co/ampixa/sanoTTS)).
|
| 39 |
+
|
| 40 |
+
Target platform: **Windows / Linux x86-64 CPU & ARM64**, running via the standard **ONNX Runtime CPU Execution Provider**. No GPU or CUDA required.
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## 1. Which Variant to Choose?
|
| 45 |
+
|
| 46 |
+
Each of the 15 voices is available in two validated formats:
|
| 47 |
+
|
| 48 |
+
### Choose FP32 if:
|
| 49 |
+
- Storage and download size are not critical.
|
| 50 |
+
- Maximum reference fidelity is the priority.
|
| 51 |
+
- x86-64 CPU performance is the main goal (measured as the fastest execution on x86 CPU).
|
| 52 |
+
|
| 53 |
+
### Choose INT8-HQ if:
|
| 54 |
+
- Smaller model and download size matters (up to 60% smaller).
|
| 55 |
+
- Bandwidth, disk footprint, or memory is constrained.
|
| 56 |
+
- Compact edge or embedded deployment is targeted.
|
| 57 |
+
|
| 58 |
+
> [!NOTE]
|
| 59 |
+
> Current speed and RTF measurements are preliminary because the benchmarking system was running under parallel background CPU workloads.
|
| 60 |
+
|
| 61 |
+
---
|
| 62 |
+
|
| 63 |
+
## 2. Download a Single Voice
|
| 64 |
+
|
| 65 |
+
You **do not need to download the full repository** (which contains all 15 voices). Using the official Hugging Face CLI (`hf`), you can download only the specific voice and runtime files needed:
|
| 66 |
+
|
| 67 |
+
### Example: German Thorsten INT8-HQ (~1.5 MB download)
|
| 68 |
+
|
| 69 |
+
**Linux / macOS:**
|
| 70 |
+
```bash
|
| 71 |
+
hf download webmp3/Sakura-sanoTTS-ONNX \
|
| 72 |
+
--include "config.json" \
|
| 73 |
+
--include "voices/de-thorsten/int8-hq/*" \
|
| 74 |
+
--include "runtime/*" \
|
| 75 |
+
--include "synthesize.py" \
|
| 76 |
+
--include "requirements.txt" \
|
| 77 |
+
--local-dir Sakura-sanoTTS
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
**Windows PowerShell:**
|
| 81 |
+
```powershell
|
| 82 |
+
hf download webmp3/Sakura-sanoTTS-ONNX `
|
| 83 |
+
--include "config.json" `
|
| 84 |
+
--include "voices/de-thorsten/int8-hq/*" `
|
| 85 |
+
--include "runtime/*" `
|
| 86 |
+
--include "synthesize.py" `
|
| 87 |
+
--include "requirements.txt" `
|
| 88 |
+
--local-dir Sakura-sanoTTS
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
**Run synthesis:**
|
| 92 |
+
```powershell
|
| 93 |
+
cd Sakura-sanoTTS
|
| 94 |
+
pip install -r requirements.txt
|
| 95 |
+
|
| 96 |
+
python synthesize.py `
|
| 97 |
+
--model voices/de-thorsten/int8-hq `
|
| 98 |
+
--text "Guten Tag, dies ist ein Test." `
|
| 99 |
+
--output output.wav
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
---
|
| 103 |
+
|
| 104 |
+
### Example: English Amy INT8-HQ (~4.0 MB download)
|
| 105 |
+
|
| 106 |
+
**Linux / macOS:**
|
| 107 |
+
```bash
|
| 108 |
+
hf download webmp3/Sakura-sanoTTS-ONNX \
|
| 109 |
+
--include "config.json" \
|
| 110 |
+
--include "voices/amy/int8-hq/*" \
|
| 111 |
+
--include "runtime/*" \
|
| 112 |
+
--include "synthesize.py" \
|
| 113 |
+
--include "requirements.txt" \
|
| 114 |
+
--local-dir Sakura-sanoTTS
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
**Windows PowerShell:**
|
| 118 |
+
```powershell
|
| 119 |
+
hf download webmp3/Sakura-sanoTTS-ONNX `
|
| 120 |
+
--include "config.json" `
|
| 121 |
+
--include "voices/amy/int8-hq/*" `
|
| 122 |
+
--include "runtime/*" `
|
| 123 |
+
--include "synthesize.py" `
|
| 124 |
+
--include "requirements.txt" `
|
| 125 |
+
--local-dir Sakura-sanoTTS
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
> **Tip:** Replace `de-thorsten` or `amy` with any voice name from the voice table below. To download an unquantized FP32 voice, replace `int8-hq` with `fp32` (e.g. `--include "voices/amy/fp32/*"`).
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
### Optional: Download Entire Repository (~114 MB)
|
| 133 |
+
|
| 134 |
+
To download all 15 voices across both FP32 and INT8-HQ:
|
| 135 |
+
|
| 136 |
+
```bash
|
| 137 |
+
hf download webmp3/Sakura-sanoTTS-ONNX --local-dir Sakura-sanoTTS-ONNX
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
---
|
| 141 |
+
|
| 142 |
+
## 3. Voice Matrix (All 15 Voices)
|
| 143 |
+
|
| 144 |
+
All 15 official sanoTTS voices have been successfully exported and verified:
|
| 145 |
+
|
| 146 |
+
| Voice | Language | Sample Rate | FP32 Size | INT8-HQ Size | Recommended Variant | Description |
|
| 147 |
+
|---|---|---:|---:|---:|---|---|
|
| 148 |
+
| **`amy`** | `en_US` | 22,050 Hz | 5.59 MB | **3.84 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Default English female voice |
|
| 149 |
+
| **`amy-1p1m`** | `en_US` | 22,050 Hz | 4.18 MB | **2.87 MB** | `INT8-HQ` (compact) | Ultra-compact English model (1.1M params) |
|
| 150 |
+
| **`amy-1p8m`** | `en_US` | 22,050 Hz | 7.04 MB | **5.29 MB** | `FP32` (speed) / `INT8-HQ` (compact) | High-capacity English voice (1.8M params) |
|
| 151 |
+
| **`kristin`** | `en_US` | 22,050 Hz | 5.36 MB | **3.62 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Expressive American English voice |
|
| 152 |
+
| **`hfc`** | `en_US` | 22,050 Hz | 7.04 MB | **5.29 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Studio-recorded English voice |
|
| 153 |
+
| **`vi`** | `vi_VN` | 22,050 Hz | 6.01 MB | **4.70 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Native Vietnamese tonal voice |
|
| 154 |
+
| **`id`** | `id_ID` | 22,050 Hz | 6.00 MB | **4.69 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Native Indonesian voice |
|
| 155 |
+
| **`heart-nano`** | `en_US` | 24,000 Hz | 0.91 MB | **0.36 MB** | `INT8-HQ` (ultra-compact) | Ultra-tiny MCU nano model (294k params) |
|
| 156 |
+
| **`heart`** | `en_US` | 24,000 Hz | 8.72 MB | **4.60 MB** | `FP32` (speed) / `INT8-HQ` (compact) | ConvNeXt neural vocoder model (2.27M params) |
|
| 157 |
+
| **`de-thorsten`** | `de_DE` | 22,050 Hz | 1.99 MB | **1.39 MB** | `FP32` (speed) / `INT8-HQ` (compact) | German voice (Thorsten corpus) |
|
| 158 |
+
| **`es-davefx`** | `es_ES` | 22,050 Hz | 1.98 MB | **1.39 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Castilian Spanish voice |
|
| 159 |
+
| **`fr-siwis`** | `fr_FR` | 22,050 Hz | 6.01 MB | **4.70 MB** | `FP32` (speed) / `INT8-HQ` (compact) | French female voice (Siwis corpus) |
|
| 160 |
+
| **`it-serena`** | `it_IT` | 22,050 Hz | 1.99 MB | **1.39 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Italian voice |
|
| 161 |
+
| **`pt-cadu`** | `pt_BR` | 22,050 Hz | 1.99 MB | **1.39 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Brazilian Portuguese voice |
|
| 162 |
+
| **`ru-irina`** | `ru_RU` | 22,050 Hz | 1.99 MB | **1.39 MB** | `FP32` (speed) / `INT8-HQ` (compact) | Russian voice |
|
| 163 |
+
|
| 164 |
+
---
|
| 165 |
+
|
| 166 |
+
## 4. Python API Usage
|
| 167 |
+
|
| 168 |
+
```python
|
| 169 |
+
from runtime.sanotts_onnx import SanoTTSOnnx
|
| 170 |
+
|
| 171 |
+
# Load any voice directory (supports FP32 and INT8-HQ)
|
| 172 |
+
tts = SanoTTSOnnx("voices/amy/int8-hq")
|
| 173 |
+
|
| 174 |
+
# Synthesize audio waveform
|
| 175 |
+
audio = tts.synthesize("Hello world! This is sanoTTS running locally on ONNX Runtime.")
|
| 176 |
+
|
| 177 |
+
# Save as standard WAV file
|
| 178 |
+
tts.save_wav("output.wav", audio)
|
| 179 |
+
print(f"Synthesized {len(audio)} samples ({len(audio)/tts.sample_rate:.2f} s) at {tts.sample_rate} Hz.")
|
| 180 |
+
```
|
| 181 |
+
|
| 182 |
+
---
|
| 183 |
+
|
| 184 |
+
## 5. Architecture & Quantization
|
| 185 |
+
|
| 186 |
+
The sanoTTS neural synthesis pipeline is modularly partitioned:
|
| 187 |
+
|
| 188 |
+
```text
|
| 189 |
+
[Text Input]
|
| 190 |
+
│
|
| 191 |
+
▼ (Python Text Frontend / G2P)
|
| 192 |
+
[Phoneme IDs]
|
| 193 |
+
│
|
| 194 |
+
├───► duration.onnx (Phoneme duration prediction)
|
| 195 |
+
│ │
|
| 196 |
+
│ ▼
|
| 197 |
+
│ [durations]
|
| 198 |
+
└───┬────────┘
|
| 199 |
+
▼
|
| 200 |
+
acoustic_token.onnx (Token-level context embedding)
|
| 201 |
+
│
|
| 202 |
+
▼
|
| 203 |
+
Context Expansion (Repeat per token duration + positional features)
|
| 204 |
+
│
|
| 205 |
+
▼
|
| 206 |
+
acoustic_frame.onnx (Frame-level convolutional blocks)
|
| 207 |
+
│
|
| 208 |
+
▼
|
| 209 |
+
decoder.onnx (Convolutional upsampling + Residual Banks)
|
| 210 |
+
│
|
| 211 |
+
▼
|
| 212 |
+
[Waveform PCM Audio] (22,050 Hz / 24,000 Hz float32)
|
| 213 |
+
```
|
| 214 |
+
|
| 215 |
+
### Quantization Methodology
|
| 216 |
+
|
| 217 |
+
- **Selective Mixed-Precision**: `INT8-HQ` uses selective mixed-precision quantization to preserve sensitive components while reducing overall model size.
|
| 218 |
+
- **Quality-Preserving Precision**: Sensitive operations are retained at higher precision where required by quality validation.
|
| 219 |
+
- **Deterministic Temporal Alignment**: The duration modeling preserves exact timing alignment relative to the unquantized reference.
|
| 220 |
+
|
| 221 |
+
---
|
| 222 |
+
|
| 223 |
+
## 6. Audio Quality Evaluation
|
| 224 |
+
|
| 225 |
+
Evaluated against the official unquantized sanoTTS reference across standardized test sentences:
|
| 226 |
+
|
| 227 |
+
| Model Variant | Format | Cosine Similarity | RMS Error | Mel L1 Spectral Diff | Status |
|
| 228 |
+
|---|---|---:|---:|---:|---|
|
| 229 |
+
| **Original Baseline** | NumPy Reference | 1.000000 | 0.000000 | 0.0000 | Ground Truth Reference |
|
| 230 |
+
| **ONNX FP32** | ONNX FP32 | **1.000000** | **0.000018** | **0.0057** | Reference Parity |
|
| 231 |
+
| **ONNX INT8-HQ** | ONNX INT8 | **0.995135** | **0.006614** | **0.6730** | High Fidelity |
|
| 232 |
+
|
| 233 |
+
- **Listening Evaluation**: No obvious audible degradation was observed in the current listening tests.
|
| 234 |
+
- **Timing Parity**: Identical sample count and zero timing drift relative to the unquantized baseline.
|
| 235 |
+
|
| 236 |
+
---
|
| 237 |
+
|
| 238 |
+
## 7. Preliminary CPU Performance
|
| 239 |
+
|
| 240 |
+
> [!NOTE]
|
| 241 |
+
> Measurements were performed on standard x86-64 CPU under parallel background system load. Absolute values are preliminary.
|
| 242 |
+
|
| 243 |
+
| Variant | Model Size | Typical RTF (Preliminary) | Compute Factor | Peak RAM |
|
| 244 |
+
|---|---:|---:|---:|---:|
|
| 245 |
+
| **ONNX FP32** | 5.59 MB | ~0.030 | **~33x Real-Time** | 222.8 MB |
|
| 246 |
+
| **ONNX INT8-HQ** | 3.84 MB | ~0.260 | **~3.8x Real-Time** | 222.2 MB |
|
| 247 |
+
|
| 248 |
+
Both FP32 and INT8 comfortably achieve real-time speech synthesis on CPU without requiring GPU acceleration.
|
| 249 |
+
|
| 250 |
+
---
|
| 251 |
+
|
| 252 |
+
## 8. Directory Structure
|
| 253 |
+
|
| 254 |
+
```text
|
| 255 |
+
Sakura-sanoTTS-ONNX/
|
| 256 |
+
├── README.md
|
| 257 |
+
├── LICENSE
|
| 258 |
+
├── NOTICE.md
|
| 259 |
+
├── SHA256SUMS
|
| 260 |
+
├── requirements.txt
|
| 261 |
+
├── synthesize.py
|
| 262 |
+
├── runtime/
|
| 263 |
+
│ ├── __init__.py
|
| 264 |
+
│ └── sanotts_onnx.py
|
| 265 |
+
├── docs/
|
| 266 |
+
│ ├── VOICE_RELEASE_MATRIX.md
|
| 267 |
+
│ ├── QUALITY.md
|
| 268 |
+
│ └── SPEED.md
|
| 269 |
+
└── voices/
|
| 270 |
+
├── amy/ (fp32/ & int8-hq/)
|
| 271 |
+
├── amy-1p1m/ (fp32/ & int8-hq/)
|
| 272 |
+
├── amy-1p8m/ (fp32/ & int8-hq/)
|
| 273 |
+
├── kristin/ (fp32/ & int8-hq/)
|
| 274 |
+
├── hfc/ (fp32/ & int8-hq/)
|
| 275 |
+
├── vi/ (fp32/ & int8-hq/)
|
| 276 |
+
├── id/ (fp32/ & int8-hq/)
|
| 277 |
+
├── heart-nano/ (fp32/ & int8-hq/)
|
| 278 |
+
├── heart/ (fp32/ & int8-hq/)
|
| 279 |
+
├── de-thorsten/ (fp32/ & int8-hq/)
|
| 280 |
+
├── es-davefx/ (fp32/ & int8-hq/)
|
| 281 |
+
├── fr-siwis/ (fp32/ & int8-hq/)
|
| 282 |
+
├── it-serena/ (fp32/ & int8-hq/)
|
| 283 |
+
├── pt-cadu/ (fp32/ & int8-hq/)
|
| 284 |
+
└── ru-irina/ (fp32/ & int8-hq/)
|
| 285 |
+
```
|
| 286 |
+
|
| 287 |
+
---
|
| 288 |
+
|
| 289 |
+
## 9. License & Attribution
|
| 290 |
+
|
| 291 |
+
- **Base Model**: [ampixa/sanoTTS](https://huggingface.co/ampixa/sanoTTS)
|
| 292 |
+
- **Original Authors**: Ampixa
|
| 293 |
+
- **License**: **GNU General Public License v3.0 (GPL-3.0)** (see [LICENSE](LICENSE))
|
| 294 |
+
- **Notice & Attribution**: Derivative conversion by Sakura / webmp3 (see [NOTICE.md](NOTICE.md)). This project is not an official Ampixa release.
|
SHA256SUMS
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
3eaf621abd4797bc39cad459a6d6926272ec2b82e6917b892324239ebba9918b docs/SPEED.md
|
| 5 |
e9bda1df73ef3b7a50da8165e15ccf60f985197744c7d3fec169aad3be90aac2 docs/VOICE_RELEASE_MATRIX.md
|
| 6 |
a8276719837f3759442669070f2fab3cb11f6b01bcca1058538a7dce1ae8bb5b requirements.txt
|
| 7 |
4cbacc2d2110ab63a194367af9b8cfc70bbc73ecb99f84b11eabda560ba1cd19 runtime/__init__.py
|
| 8 |
-
|
| 9 |
3fd8a48b505e708b20d83f22c89e4540e657453b2dcffba793abb37b1ea8b1ac synthesize.py
|
| 10 |
37b702f8b235242b0af6879bd061bc66085c5bfbcb82f10f31ef8ba9600435eb voices/amy-1p1m/fp32/acoustic_frame.onnx
|
| 11 |
4f1402c7a7741835b441ffc72652d03aeb7c9f8cca1c9a0e080fa0b8dc40e632 voices/amy-1p1m/fp32/acoustic_token.onnx
|
|
|
|
| 1 |
+
0b383d5a63da644f628d99c33976ea6487ed89aaa59f0b3257992deac1171e6b LICENSE
|
| 2 |
+
180216ded255a6b5989ceae86866f4a720da84eb3ebd124587723497fc6e6c48 NOTICE.md
|
| 3 |
+
2c165d89b3928a1535ba3d7614ebed51b8ce85b733c3a397d965a11336171d8f README.md
|
| 4 |
+
e77f6d1aeda3c5415fc146de8819d30d4e504279cdb611a1a2ca85fbca8ec7cd config.json
|
| 5 |
+
dc94f59dc445304bad85e7c46e1c4d45cbbdf4988864928ccdb66010ee5a7ae5 docs/QUALITY.md
|
| 6 |
3eaf621abd4797bc39cad459a6d6926272ec2b82e6917b892324239ebba9918b docs/SPEED.md
|
| 7 |
e9bda1df73ef3b7a50da8165e15ccf60f985197744c7d3fec169aad3be90aac2 docs/VOICE_RELEASE_MATRIX.md
|
| 8 |
a8276719837f3759442669070f2fab3cb11f6b01bcca1058538a7dce1ae8bb5b requirements.txt
|
| 9 |
4cbacc2d2110ab63a194367af9b8cfc70bbc73ecb99f84b11eabda560ba1cd19 runtime/__init__.py
|
| 10 |
+
f2af96b8f4abdb3653d5cfa67e11e12ccb344c640f5a97aaf901ff71802b720c runtime/sanotts_onnx.py
|
| 11 |
3fd8a48b505e708b20d83f22c89e4540e657453b2dcffba793abb37b1ea8b1ac synthesize.py
|
| 12 |
37b702f8b235242b0af6879bd061bc66085c5bfbcb82f10f31ef8ba9600435eb voices/amy-1p1m/fp32/acoustic_frame.onnx
|
| 13 |
4f1402c7a7741835b441ffc72652d03aeb7c9f8cca1c9a0e080fa0b8dc40e632 voices/amy-1p1m/fp32/acoustic_token.onnx
|
config.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "sanotts",
|
| 3 |
+
"format": "onnx",
|
| 4 |
+
"runtime": "onnxruntime",
|
| 5 |
+
"default_precision": "int8-hq",
|
| 6 |
+
"base_model": "ampixa/sanoTTS",
|
| 7 |
+
"voices_root": "voices",
|
| 8 |
+
"languages": [
|
| 9 |
+
"en",
|
| 10 |
+
"de",
|
| 11 |
+
"es",
|
| 12 |
+
"fr",
|
| 13 |
+
"it",
|
| 14 |
+
"pt",
|
| 15 |
+
"ru",
|
| 16 |
+
"vi",
|
| 17 |
+
"id"
|
| 18 |
+
]
|
| 19 |
+
}
|
docs/QUALITY.md
CHANGED
|
@@ -1,29 +1,28 @@
|
|
| 1 |
-
# sanoTTS ONNX: Audioqualitäts-Benchmark
|
| 2 |
-
|
| 3 |
-
Evaluation der Audioqualität über alle 5 standardisierten Testsätze im direkten Vergleich zur originalen NumPy-Referenz (`ampixa/sanoTTS`).
|
| 4 |
-
|
| 5 |
-
## 1. Zusammenfassung (Durchschnitt über alle Testsätze)
|
| 6 |
-
|
| 7 |
-
| Modellvariante | Format | Cosine Similarity | RMS Error | Mel L1 Diff | STFT L1 Diff | Peak Diff | Status |
|
| 8 |
-
|---|---|---:|---:|---:|---:|---:|---|
|
| 9 |
-
| **Original Baseline** | NumPy Reference | 1.000000 | 0.000000 | 0.0000 | 0.0000 | 0.0000 | Ground Truth |
|
| 10 |
-
| **ONNX FP32** | ONNX | 1.000000 | 0.000018 | 0.0057 | 0.0000 | 0.000016 |
|
| 11 |
-
| **ONNX INT8
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
| 17 |
-
|
|
| 18 |
-
| `
|
| 19 |
-
| `
|
| 20 |
-
| `
|
| 21 |
-
| `
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
- **ONNX
|
| 27 |
-
- **
|
| 28 |
-
- **
|
| 29 |
-
- **Quantisierungs-Sensitivität**: Das Ausschließen der 7-Tap Ausgangsprojektionsschicht (`/post/Conv`, 168 Parameter) bewahrte den Mel-Spektralfehler auf niedrigstem Niveau.
|
|
|
|
| 1 |
+
# sanoTTS ONNX: Audioqualitäts-Benchmark
|
| 2 |
+
|
| 3 |
+
Evaluation der Audioqualität über alle 5 standardisierten Testsätze im direkten Vergleich zur originalen NumPy-Referenz (`ampixa/sanoTTS`).
|
| 4 |
+
|
| 5 |
+
## 1. Zusammenfassung (Durchschnitt über alle Testsätze)
|
| 6 |
+
|
| 7 |
+
| Modellvariante | Format | Cosine Similarity | RMS Error | Mel L1 Diff | STFT L1 Diff | Peak Diff | Status |
|
| 8 |
+
|---|---|---:|---:|---:|---:|---:|---|
|
| 9 |
+
| **Original Baseline** | NumPy Reference | 1.000000 | 0.000000 | 0.0000 | 0.0000 | 0.0000 | Ground Truth Referenz |
|
| 10 |
+
| **ONNX FP32** | ONNX FP32 | 1.000000 | 0.000018 | 0.0057 | 0.0000 | 0.000016 | Hohe Parität (>0.9999) |
|
| 11 |
+
| **ONNX INT8-HQ** | ONNX INT8 | 0.995135 | 0.006614 | 0.6730 | 0.0001 | 0.006641 | Hohe Wiedergabetreue (>0.99) |
|
| 12 |
+
|
| 13 |
+
## 2. Einzelergebnisse pro Testsatz (ONNX INT8-HQ)
|
| 14 |
+
|
| 15 |
+
| ID | Testsatz | Cosine Similarity | RMS Error | Mel L1 Diff |
|
| 16 |
+
|---|---|---:|---:|---:|
|
| 17 |
+
| `sentence_01` | "Hello, this is a test of the sano TTS model." | 0.994923 | 0.006901 | 0.5931 |
|
| 18 |
+
| `sentence_02` | "The quick brown fox jumps over the lazy dog." | 0.996201 | 0.006260 | 0.6329 |
|
| 19 |
+
| `sentence_03` | "Today is October sixth, twenty twenty-six." | 0.994155 | 0.007006 | 0.5746 |
|
| 20 |
+
| `sentence_04` | "Numbers: one, two, three, forty-two, one hundred and twenty." | 0.996363 | 0.005854 | 0.9146 |
|
| 21 |
+
| `sentence_05` | "This sentence contains punctuation, commas, pauses, and a question?" | 0.994033 | 0.007046 | 0.6498 |
|
| 22 |
+
|
| 23 |
+
## 3. Bewertung der Sprachqualität
|
| 24 |
+
|
| 25 |
+
- **ONNX FP32**: Erreicht eine durchschnittliche Cosine Similarity von **1.000000** und einen RMS-Fehler von **0.000018**. Die Waveform-Rekonstruktion stimmt innerhalb üblicher 32-Bit-Gleitkommatoleranzen mit der Referenz überein.
|
| 26 |
+
- **ONNX INT8-HQ**: Erreicht eine Cosine Similarity von **0.9951** auf den Rohdaten der Audiosignale bei einer geringen Mel-L1-Differenz von **0.673**. In den durchgeführten Hörtests wurde keine auffällige hörbare Degradation beobachtet.
|
| 27 |
+
- **Timing & Prosodie**: Die Dauerbestimmung pro Phonem-Token zeigt keinen Timing-Drift im Vergleich zur unquantisierten Referenz (identische Sample-Anzahl).
|
| 28 |
+
- **Selektive Mixed-Precision**: INT8-HQ nutzt gezielte Mixed-Precision-Quantisierung, um sensitive Komponenten zu schützen und gleichzeitig die Modellgröße signifikant zu reduzieren. Sensitivere Operationen verbleiben dort in höherer Präzision, wo dies durch die Qualitätsvalidierung gefordert ist.
|
|
|
runtime/sanotts_onnx.py
CHANGED
|
@@ -44,6 +44,19 @@ class SanoTTSOnnx:
|
|
| 44 |
|
| 45 |
self.is_nano = (self.model_dir / "meta.json").is_file() and not (self.model_dir / "piper-phoneme-config.json").is_file()
|
| 46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
if self.is_nano:
|
| 48 |
self._init_nano()
|
| 49 |
else:
|
|
|
|
| 44 |
|
| 45 |
self.is_nano = (self.model_dir / "meta.json").is_file() and not (self.model_dir / "piper-phoneme-config.json").is_file()
|
| 46 |
|
| 47 |
+
# Optional root release manifest detection
|
| 48 |
+
self.root_manifest = None
|
| 49 |
+
for candidate in [self.model_dir.parent.parent / "config.json", Path("config.json")]:
|
| 50 |
+
if candidate.is_file():
|
| 51 |
+
try:
|
| 52 |
+
with open(candidate, "r", encoding="utf-8") as f:
|
| 53 |
+
meta = json.load(f)
|
| 54 |
+
if meta.get("model_type") == "sanotts":
|
| 55 |
+
self.root_manifest = meta
|
| 56 |
+
break
|
| 57 |
+
except Exception:
|
| 58 |
+
pass
|
| 59 |
+
|
| 60 |
if self.is_nano:
|
| 61 |
self._init_nano()
|
| 62 |
else:
|