File size: 4,494 Bytes
cefb829
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a61555f
cefb829
a61555f
cefb829
a61555f
cefb829
a61555f
cefb829
a61555f
cefb829
a61555f
 
 
 
 
cefb829
a61555f
cefb829
a61555f
cefb829
22054b5
a61555f
22054b5
 
 
 
cefb829
a61555f
cefb829
 
a61555f
cefb829
 
 
 
 
 
 
 
a61555f
 
cefb829
 
 
 
a61555f
 
cefb829
 
 
 
 
 
 
 
 
 
 
 
 
 
a61555f
cefb829
 
 
a61555f
 
cefb829
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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
---
license: apache-2.0
library_name: onnx
base_model: n4ze3m/tiny-voca
base_model_relation: quantized
pipeline_tag: text-to-speech
language:
- en
tags:
- onnx
- int8
- quantized
- text-to-speech
- tts
- tiny-voca
- edge
- cpu
---

# tiny-voca Kenosis: CPU Optimized, 5.39 MB

[tiny-voca](https://huggingface.co/n4ze3m/tiny-voca) (Muhammed Nazeem, Apache-2.0) is a two-voice 24 kHz English text-to-speech model (`F2`, `M2`). Quantized models often shrink file size at the cost of accuracy or speed. This [Kenosis](https://coreepoch.dev/kenosis/) model is smaller than the original, keeps accuracy near the original, and runs **faster** on CPU with no retraining. One standard `.onnx` file runs on CPU in both ONNX Runtime and OpenVINO, with identical inputs and outputs.

![tiny-voca Kenosis CPU comparison](./tiny_voca_comparison.png)

## Accuracy

Word error rate (WER, lower is better) from `faster-whisper` `base.en` on 68 clips from `eval_sentences.json`. tiny-voca uses a random noise signal, so the counts in parentheses can differ by one word between runs. Sizes are `.onnx` files only (`config.json` and `phonemizer/` are unchanged). Calibrated on 64 English utterances (32 original sentences across both voices, disjoint from `eval_sentences.json`), with no retraining.

| Model | ONNX Runtime | OpenVINO | Size |
|---|---:|---:|---:|
| Original | 1.00% (8/804) | 1.00% (8/804) | 21.39 MB |
| ORT `quantize_dynamic` | 0.87% (7/804) | 0.87% (7/804) | 8.12 MB |
| **Kenosis** | **1.12% (9/804)** | **1.49% (12/804)** | **5.39 MB** |

## Speed

Median time for a 5.7-second sentence over 10 runs on a CPU with AVX-VNNI. Values in parentheses are multiples of real time (RT, higher is faster).

| Runtime | Threads | Original | Kenosis | ORT `quantize_dynamic` |
|---|---:|---:|---:|---:|
| ONNX Runtime | 1 | 109.7 ms (51.7x) | **69.8 ms (81.4x)** | 127.6 ms (45.1x) |
| ONNX Runtime | 4 | 57.8 ms (98.1x) | **32.1 ms (177.0x)** | 82.1 ms (70.1x) |
| OpenVINO | 1 | 127.6 ms (44.5x) | **89.4 ms (63.6x)** | 160.1 ms (35.9x) |
| OpenVINO | 4 | 56.5 ms (100.5x) | **39.4 ms (144.2x)** | 67.2 ms (85.6x) |

## Run

```python
# pip install huggingface_hub onnxruntime numpy soundfile git+https://github.com/n4ze3m/dizione
import os
from pathlib import Path
from huggingface_hub import snapshot_download
import numpy as np
import onnxruntime as ort
import soundfile as sf

repo = Path(snapshot_download(
    "CoreEpoch/tiny-voca-kenosis",
    allow_patterns=["tiny_voca_kenosis.onnx", "phonemizer/*"],
))
os.environ["DIZIONE_DATA"] = str(repo / "phonemizer")
import dizione

sess = ort.InferenceSession(str(repo / "tiny_voca_kenosis.onnx"), providers=["CPUExecutionProvider"])
phones = dizione.phonemize("Hello! This is an offline voice running on your processor.")
audio = sess.run(["audio"], {
    "tokens": np.array([phones.ids], dtype=np.int64),
    "stress": np.array([phones.stress], dtype=np.int64),
    "voice": np.array([0], dtype=np.int64),        # 0 = F2, 1 = M2
    "speed": np.array([1.0], dtype=np.float32),
    "pitch_shift": np.array([0.0], dtype=np.float32),
    "pitch_range": np.array([1.0], dtype=np.float32),
})[0][0]
peak = float(np.max(np.abs(audio)))
if peak > 0.99:
    audio = audio * (0.99 / peak)
sf.write("out.wav", audio, 24000)
```

Inputs: `tokens`, `stress`, `voice` (`0` = `F2`, `1` = `M2`), `speed`, `pitch_shift`, `pitch_range`. Outputs: `audio [1, samples]` (24 kHz), `durations [1, N]`. For OpenVINO, load the same `tiny_voca_kenosis.onnx` with `openvino.Core().compile_model(..., "CPU")`. Repo includes `run_tts.py` (CLI without `dizione`) and `eval_tts.py` (68-clip check).

## Integrity & license

`tiny_voca_kenosis.onnx` (5,392,846 B), SHA-256 `87aca4870f754b8b7093a788225ae747ec3372cbf560171f471bff1f3b2f21f1`.
Apache-2.0 (base [n4ze3m/tiny-voca](https://huggingface.co/n4ze3m/tiny-voca) by Muhammed Nazeem, `onnx/model.onnx` SHA-256 `fe6d918791a15b82e37465981d7f27a070e46b46635e5a3482fc8dff87a1ae46`, retained; see `LICENSE` and `NOTICE`). `config.json` and `phonemizer/` are redistributed unmodified from `n4ze3m/tiny-voca`; `phonemizer/` keeps its own third-party licenses (`LICENSE.cmudict`, `LICENSE.homograph-data`). Apache-2.0 covers Core Epoch LLC's model derivative, scripts, evaluation sentences, chart, and documentation (plus `config.json`). It grants no rights in Kenosis, Core Epoch LLC's quantizer, which remains proprietary.

Benchmarks and contact: [coreepoch.dev/kenosis](https://coreepoch.dev/kenosis/) · contact@coreepoch.dev