Joshuant commited on
Commit
2539900
·
verified ·
1 Parent(s): 4c9a297

roxi-tts-v2 ONNX/CPU build (tuned sampling; IIT-M attribution)

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ moss_tts_global_shared.data filter=lfs diff=lfs merge=lfs -text
37
+ moss_tts_local_shared.data filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ pipeline_tag: text-to-speech
6
+ base_model: IOTEverythin/roxi-tts-v2
7
+ tags:
8
+ - text-to-speech
9
+ - tts
10
+ - onnx
11
+ - cpu
12
+ - moss-tts-nano
13
+ - indian-english
14
+ ---
15
+
16
+ # Roxi-TTS v2 — ONNX / CPU build
17
+
18
+ **ONNX export of [`IOTEverythin/roxi-tts-v2`](https://huggingface.co/IOTEverythin/roxi-tts-v2)**
19
+ (MOSS-TTS-Nano LoRA, Indian-English) for **CPU / on-device** inference via `onnxruntime` —
20
+ no PyTorch required at inference. 48 kHz output.
21
+
22
+ > Use this **ONNX** build for fast CPU serving. For **maximum voice fidelity**, use the PyTorch
23
+ > build [`IOTEverythin/roxi-tts-v2`](https://huggingface.co/IOTEverythin/roxi-tts-v2) (see quality note).
24
+
25
+ ## Contents
26
+ Browser/CPU ONNX bundle exported with MOSS-TTS-Nano's official exporter:
27
+ `moss_tts_prefill.onnx`, `moss_tts_decode_step.onnx`, `moss_tts_local_*` graphs,
28
+ shared external data (`*_shared.data`), `tokenizer.model`, `browser_poc_manifest.json`,
29
+ `tts_browser_onnx_meta.json`. The audio **codec** is the official Apache-2.0
30
+ [`OpenMOSS-Team/MOSS-Audio-Tokenizer-Nano-ONNX`](https://huggingface.co/OpenMOSS-Team/MOSS-Audio-Tokenizer-Nano-ONNX)
31
+ (not re-hosted here).
32
+
33
+ ## Usage (onnxruntime, CPU)
34
+ Uses the runtime from the [MOSS-TTS-Nano repo](https://github.com/OpenMOSS/MOSS-TTS-Nano)
35
+ (`infer_onnx.py`). Lay the assets out as `<dir>/MOSS-TTS-Nano-100M-ONNX` + `<dir>/MOSS-Audio-Tokenizer-Nano-ONNX`:
36
+ ```bash
37
+ pip install "onnxruntime>=1.20" soundfile numpy
38
+ git clone https://github.com/OpenMOSS/MOSS-TTS-Nano && cd MOSS-TTS-Nano
39
+ huggingface-cli download IOTEverythin/roxi-tts-v2-onnx --local-dir assets/MOSS-TTS-Nano-100M-ONNX
40
+ huggingface-cli download OpenMOSS-Team/MOSS-Audio-Tokenizer-Nano-ONNX --local-dir assets/MOSS-Audio-Tokenizer-Nano-ONNX
41
+
42
+ python infer_onnx.py --model-dir assets \
43
+ --text "Welcome. Your appointment is confirmed for Monday at ten thirty in the morning." \
44
+ --output-audio-path out.wav --execution-provider cpu --cpu-threads 8 \
45
+ --sample-mode full --audio-temperature 0.8 --audio-top-p 0.9 --audio-repetition-penalty 1.1 \
46
+ --disable-wetext-processing
47
+ ```
48
+ **Recommended sampling (tuned for voice fidelity):** `--sample-mode full --audio-temperature 0.8
49
+ --audio-top-p 0.9 --audio-repetition-penalty 1.1`. (Greedy collapses the voice; the default
50
+ `fixed` mode is lower fidelity.)
51
+
52
+ ## Quality (measured, CPU, vs the PyTorch build)
53
+ | Build | Speaker similarity to target ↑ | Intelligibility WER ↓ |
54
+ |---|---|---|
55
+ | roxi-tts-v2 (PyTorch) | **0.96** | 0.26 |
56
+ | **roxi-tts-v2-onnx (this, tuned)** | **0.73** | **0.25** |
57
+ | base MOSS (reference) | 0.52 | 0.26 |
58
+
59
+ - **Intelligibility is on par** with PyTorch (WER ~0.25).
60
+ - **Voice identity is somewhat weaker than PyTorch** (0.73 vs 0.96) — the ONNX streaming/fixed-frame
61
+ decode + fp32 approximate the PyTorch generation path. It is still clearly the fine-tuned
62
+ Indian-English voice (well above base 0.52). Use the PyTorch build if you need full fidelity.
63
+ - **Speed:** ONNX is the faster CPU path (independent reports ~RTF 0.23–0.28 @ 8 threads, ~2× the
64
+ PyTorch CPU path) once loaded in a persistent server.
65
+
66
+ ## Attribution & license
67
+ - Apache-2.0 (matching base). Built on **MOSS-TTS-Nano** (Apache-2.0) + audio tokenizer (Apache-2.0).
68
+ - Training data: IIT-Madras **Indic TTS** (English) via `SPRINGLab/IndicTTS-English`. Required notice:
69
+ *"COPYRIGHT 2016 TTS Consortium, TDIL, Meity — Hema A. Murthy & S. Umesh — IIT Madras. ALL RIGHTS RESERVED."*
70
+ - **Responsible use:** derived from a real dataset speaker — do not use to impersonate real people,
71
+ for fraud, or deception; disclose AI-generated audio where required.
browser_poc_manifest.json ADDED
The diff for this file is too large to render. See raw diff
 
moss_tts_decode_step.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:698cbc2fc1c2feca16e5895614ed52bbb32ded10f236c076f477b2e69abf32d8
3
+ size 291483
moss_tts_global_shared.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f5044370e12c754f82560690db3f270e019ab29ce4f53c75c5ad4d74c84b63fc
3
+ size 440813568
moss_tts_local_cached_step.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa9035fefc1c138a951a8bcfc0374fb03a25f1ece67f7f7f53bce349b84a1dd5
3
+ size 53685
moss_tts_local_decoder.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51aa754301b38550a5f9adda0ad93bd3dc95819afb511e6dcabf4a90b345a454
3
+ size 49231
moss_tts_local_fixed_sampled_frame.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40cdb00efc171c450cf91468e01429caa41b0252222cd308e978f58fe354afa8
3
+ size 471262
moss_tts_local_shared.data ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fd95020ca151295fa2ee4eac114785ee2c6ee055a179a7ea5b3d1c6b5e306691
3
+ size 229678080
moss_tts_prefill.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d56126dcd0574c2f15d98fc6b35eda68d0386b5bd9c5e38e28548d6f2ea8f3db
3
+ size 283305
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c353ee1479b536bf414c1b247f5542b6607fb8ae91320e5af1781fee200fddff
3
+ size 470897
tts_browser_onnx_meta.json ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "format_version": 1,
3
+ "checkpoint_path": "merged-ep5",
4
+ "files": {
5
+ "prefill": "moss_tts_prefill.onnx",
6
+ "decode_step": "moss_tts_decode_step.onnx",
7
+ "local_decoder": "moss_tts_local_decoder.onnx",
8
+ "local_cached_step": "moss_tts_local_cached_step.onnx",
9
+ "local_fixed_sampled_frame": "moss_tts_local_fixed_sampled_frame.onnx"
10
+ },
11
+ "external_data_files": {
12
+ "moss_tts_prefill.onnx": [
13
+ "moss_tts_global_shared.data"
14
+ ],
15
+ "moss_tts_decode_step.onnx": [
16
+ "moss_tts_global_shared.data"
17
+ ],
18
+ "moss_tts_local_decoder.onnx": [
19
+ "moss_tts_local_shared.data"
20
+ ],
21
+ "moss_tts_local_cached_step.onnx": [
22
+ "moss_tts_local_shared.data"
23
+ ],
24
+ "moss_tts_local_fixed_sampled_frame.onnx": [
25
+ "moss_tts_local_shared.data"
26
+ ]
27
+ },
28
+ "model_config": {
29
+ "n_vq": 16,
30
+ "row_width": 17,
31
+ "hidden_size": 768,
32
+ "global_layers": 12,
33
+ "global_heads": 12,
34
+ "head_dim": 64,
35
+ "local_layers": 1,
36
+ "local_heads": 12,
37
+ "local_head_dim": 64,
38
+ "vocab_size": 16384,
39
+ "audio_codebook_sizes": [
40
+ 1024,
41
+ 1024,
42
+ 1024,
43
+ 1024,
44
+ 1024,
45
+ 1024,
46
+ 1024,
47
+ 1024,
48
+ 1024,
49
+ 1024,
50
+ 1024,
51
+ 1024,
52
+ 1024,
53
+ 1024,
54
+ 1024,
55
+ 1024
56
+ ],
57
+ "audio_pad_token_id": 1024,
58
+ "pad_token_id": 3,
59
+ "im_start_token_id": 4,
60
+ "im_end_token_id": 5,
61
+ "audio_start_token_id": 6,
62
+ "audio_end_token_id": 7,
63
+ "audio_user_slot_token_id": 8,
64
+ "audio_assistant_slot_token_id": 9
65
+ },
66
+ "onnx": {
67
+ "opset": 17,
68
+ "prefill_output_names": [
69
+ "global_hidden",
70
+ "present_key_0",
71
+ "present_value_0",
72
+ "present_key_1",
73
+ "present_value_1",
74
+ "present_key_2",
75
+ "present_value_2",
76
+ "present_key_3",
77
+ "present_value_3",
78
+ "present_key_4",
79
+ "present_value_4",
80
+ "present_key_5",
81
+ "present_value_5",
82
+ "present_key_6",
83
+ "present_value_6",
84
+ "present_key_7",
85
+ "present_value_7",
86
+ "present_key_8",
87
+ "present_value_8",
88
+ "present_key_9",
89
+ "present_value_9",
90
+ "present_key_10",
91
+ "present_value_10",
92
+ "present_key_11",
93
+ "present_value_11"
94
+ ],
95
+ "decode_input_names": [
96
+ "input_ids",
97
+ "past_valid_lengths",
98
+ "past_key_0",
99
+ "past_value_0",
100
+ "past_key_1",
101
+ "past_value_1",
102
+ "past_key_2",
103
+ "past_value_2",
104
+ "past_key_3",
105
+ "past_value_3",
106
+ "past_key_4",
107
+ "past_value_4",
108
+ "past_key_5",
109
+ "past_value_5",
110
+ "past_key_6",
111
+ "past_value_6",
112
+ "past_key_7",
113
+ "past_value_7",
114
+ "past_key_8",
115
+ "past_value_8",
116
+ "past_key_9",
117
+ "past_value_9",
118
+ "past_key_10",
119
+ "past_value_10",
120
+ "past_key_11",
121
+ "past_value_11"
122
+ ],
123
+ "decode_output_names": [
124
+ "global_hidden",
125
+ "present_key_0",
126
+ "present_value_0",
127
+ "present_key_1",
128
+ "present_value_1",
129
+ "present_key_2",
130
+ "present_value_2",
131
+ "present_key_3",
132
+ "present_value_3",
133
+ "present_key_4",
134
+ "present_value_4",
135
+ "present_key_5",
136
+ "present_value_5",
137
+ "present_key_6",
138
+ "present_value_6",
139
+ "present_key_7",
140
+ "present_value_7",
141
+ "present_key_8",
142
+ "present_value_8",
143
+ "present_key_9",
144
+ "present_value_9",
145
+ "present_key_10",
146
+ "present_value_10",
147
+ "present_key_11",
148
+ "present_value_11"
149
+ ],
150
+ "local_cached_input_names": [
151
+ "global_hidden",
152
+ "text_token_id",
153
+ "audio_token_id",
154
+ "channel_index",
155
+ "step_type",
156
+ "past_valid_lengths",
157
+ "local_past_key_0",
158
+ "local_past_value_0"
159
+ ],
160
+ "local_cached_output_names": [
161
+ "text_logits",
162
+ "audio_logits",
163
+ "local_present_key_0",
164
+ "local_present_value_0"
165
+ ],
166
+ "local_fixed_sampled_frame_input_names": [
167
+ "global_hidden",
168
+ "repetition_seen_mask",
169
+ "assistant_random_u",
170
+ "audio_random_u"
171
+ ],
172
+ "local_fixed_sampled_frame_output_names": [
173
+ "should_continue",
174
+ "frame_token_ids"
175
+ ],
176
+ "fixed_sampled_frame_constants": {
177
+ "text_temperature": 1.0,
178
+ "text_top_p": 1.0,
179
+ "text_top_k": 50,
180
+ "audio_temperature": 0.8,
181
+ "audio_top_p": 0.95,
182
+ "audio_top_k": 25,
183
+ "audio_repetition_penalty": 1.2
184
+ }
185
+ }
186
+ }