owensong commited on
Commit
b0996d2
·
verified ·
1 Parent(s): 1a5f1dd

Simplify README and add final banner image

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +57 -154
  3. assets/inflect-nano-banner.png +3 -0
.gitattributes CHANGED
@@ -1,3 +1,4 @@
1
  *.pt filter=lfs diff=lfs merge=lfs -text
2
  *.wav filter=lfs diff=lfs merge=lfs -text
 
3
  tiny_tts/text/cmudict_cache.pickle filter=lfs diff=lfs merge=lfs -text
 
1
  *.pt filter=lfs diff=lfs merge=lfs -text
2
  *.wav filter=lfs diff=lfs merge=lfs -text
3
+ assets/inflect-nano-banner.png filter=lfs diff=lfs merge=lfs -text
4
  tiny_tts/text/cmudict_cache.pickle filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -16,26 +16,27 @@ library_name: pytorch
16
  ---
17
 
18
  <p align="center">
19
- <img src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/assets/inflect-nano-banner.svg" alt="Inflect-Nano-v1 banner" width="100%">
20
  </p>
21
 
22
  # Inflect-Nano-v1
23
 
24
- **Inflect-Nano-v1 is a 4.63M-parameter English text-to-speech model, including its neural vocoder.**
25
 
26
- It is built around one question: how usable can a complete local TTS stack get when the entire inference model is smaller than many single embeddings tables in modern speech systems?
27
 
28
- This is not a SOTA voice model. The point is the size-to-functionality ratio: a complete text-to-waveform TTS pipeline that is small enough for tiny local experiments, offline assistants, embedded prototypes, browser/WASM-style work, and efficient inference research.
29
 
30
- <p align="center">
31
- <b>4.632M total params</b> | <b>3.465M acoustic</b> | <b>1.167M vocoder</b> | <b>24 kHz</b> | <b>English</b>
32
- </p>
 
 
 
33
 
34
- ## Listen First
35
 
36
- These examples cover punctuation, short questions, numbers, hard words, longer phrasing, and transition-heavy prompts.
37
-
38
- | Prompt | Audio |
39
  |---|---|
40
  | "Did the timing change?" she answered. "Then why did Logan leave?" | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_01.wav"></audio> |
41
  | Who puts a parking meter next to an ER label? | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_02.wav"></audio> |
@@ -46,41 +47,7 @@ These examples cover punctuation, short questions, numbers, hard words, longer p
46
  | If Logan sounded uneasy, then it happened near Long Beach, and the pause has to carry that. | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_07.wav"></audio> |
47
  | The word aluminum should not steal attention from the softer ending after entrepreneur. | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_08.wav"></audio> |
48
 
49
- ## Why This Exists
50
-
51
- Most strong TTS models are large. Many "small" TTS demos also depend on a larger external vocoder, which hides a lot of the real inference cost. Inflect-Nano-v1 counts both sides:
52
-
53
- ```text
54
- text -> acoustic model -> mel spectrogram -> neural vocoder -> waveform
55
- ```
56
-
57
- The model is intentionally constrained:
58
-
59
- | Capability | Inflect-Nano-v1 |
60
- |---|---:|
61
- | Complete text-to-waveform stack | Yes |
62
- | External vocoder required | No |
63
- | Total inference parameters | **4.632M** |
64
- | Sample rate | **24 kHz** |
65
- | Language | English |
66
- | Voice count | 1 |
67
- | Voice cloning | No |
68
- | Multilingual | No |
69
-
70
- ## Size Context
71
-
72
- Approximate parameter comparison:
73
-
74
- | Model / class | Params | Relative to Inflect-Nano-v1 |
75
- |---|---:|---:|
76
- | Inflect-Nano-v1 | **4.63M** | 1.0x |
77
- | Kokoro-82M | ~82M | ~17.7x larger |
78
- | Chatterbox-sized TTS | ~500M | ~108x larger |
79
- | Multi-billion TTS systems | 1B+ | 216x+ larger |
80
-
81
- The comparison is about model scale, not quality parity. Larger models are expected to sound better.
82
-
83
- ## Quickstart
84
 
85
  ```bash
86
  git clone https://huggingface.co/owensong/Inflect-Nano-v1
@@ -88,28 +55,23 @@ cd Inflect-Nano-v1
88
  pip install -r requirements.txt
89
  ```
90
 
91
- Generate audio:
92
 
93
  ```bash
94
- python inference.py \
95
- --text "Wait, are you actually being for real now? I can't believe it!" \
96
- --out sample.wav
97
  ```
98
 
99
  CPU:
100
 
101
  ```bash
102
- python inference.py \
103
- --device cpu \
104
- --text "Please say neighborhood, statistics, and anesthesiologist clearly." \
105
- --out sample_cpu.wav
106
  ```
107
 
108
- Optional controls:
109
 
110
  ```bash
111
  python inference.py \
112
- --text "No, seriously, did Jordan leave the receipt in Albuquerque?" \
113
  --length-scale 1.03 \
114
  --pitch-scale 1.00 \
115
  --energy-scale 1.00 \
@@ -122,138 +84,79 @@ Local Gradio demo:
122
  python app.py
123
  ```
124
 
125
- The text frontend may download tokenizer files on first run.
126
-
127
- ## Model Summary
128
 
129
- | Component | Parameters | Notes |
130
- |---|---:|---|
131
- | Acoustic model | **3,465,125** | Compact non-autoregressive FastSpeech-style model |
132
- | Vocoder generator | **1,167,077** | Snake V2Mid HiFi-GAN-style generator |
133
- | Total inference model | **4,632,202** | Acoustic + vocoder |
134
 
135
- Model files:
136
 
137
  ```text
138
  weights/inflect_nano_v1_acoustic.pt
139
  weights/inflect_nano_v1_vocoder.pt
140
  ```
141
 
142
- ## Architecture
143
 
144
- Inflect-Nano-v1 is a two-part TTS stack:
 
 
145
 
146
  ```text
147
- Text
148
- -> English normalization + G2P frontend
149
- -> Compact FastSpeech-style acoustic model
150
- -> 80-bin mel spectrogram
151
- -> Snake V2Mid HiFi-GAN-style vocoder
152
- -> 24 kHz waveform
153
  ```
154
 
155
- ### Acoustic Model
156
-
157
- The acoustic model predicts duration, energy, brightness, and pitch, expands token states into frame states, and decodes 80-bin mel spectrograms.
158
-
159
- Main config:
160
-
161
- ```json
162
- {
163
- "hidden": 168,
164
- "encoder_layers": 5,
165
- "decoder_layers": 6,
166
- "decoder_ff_mult": 3,
167
- "kernel_size": 7,
168
- "speaker_dim": 64,
169
- "dropout": 0.08,
170
- "n_mels": 80,
171
- "sample_rate": 24000,
172
- "max_frames": 1400,
173
- "postnet_scale": 0.1,
174
- "use_frame_pitch": true,
175
- "abs_frame_bins": 512
176
- }
177
- ```
178
 
179
- Approximate acoustic split:
180
 
181
- ```text
182
- total acoustic: 3.465M
183
- encoder: 1.292M
184
- decoder: 1.211M
185
- postnet: 0.276M
186
- local context: 0.226M
187
- frame GRU: 0.128M
188
- heads/embeds/projections: remainder
189
- ```
190
 
191
- ### Vocoder
192
-
193
- The vocoder is a custom Snake-activation HiFi-GAN-style generator. Discriminators are training-only and are not included in inference parameter counts.
194
-
195
- Main config:
196
-
197
- ```json
198
- {
199
- "variant": "snake_v2mid",
200
- "sample_rate": 24000,
201
- "n_fft": 1024,
202
- "hop_size": 256,
203
- "win_size": 1024,
204
- "num_mels": 80,
205
- "fmax": 12000.0,
206
- "upsample_rates": [8, 8, 2, 2],
207
- "upsample_kernel_sizes": [16, 16, 4, 4],
208
- "upsample_initial_channel": 144,
209
- "resblock_kernel_sizes": [3, 7, 11],
210
- "resblock_dilation_sizes": [[1, 3, 5], [1, 3, 5], [1, 3, 5]],
211
- "activation": "snake"
212
- }
213
- ```
214
 
215
- ## Intended Use
 
 
 
 
 
 
 
216
 
217
- Good fits:
218
 
219
  - Tiny local TTS experiments
220
  - Offline assistant prototypes
221
- - Embedded or low-resource speech demos
222
  - Efficient inference research
 
223
  - Browser/WASM-style exploration
224
- - Baseline for sub-5M TTS work
225
 
226
- Poor fits:
227
 
228
  - Production narration
229
  - Accessibility-critical output
230
  - Voice cloning
231
- - Multilingual TTS
232
- - High-fidelity studio speech
233
- - Long-form audiobook generation
234
 
235
  ## Limitations
236
 
237
- This model is intentionally tiny and has clear quality limits:
238
-
239
- - Unseen text can stumble or sound unstable.
240
- - The voice can sound robotic, buzzy, or artifacted.
241
- - Long or unusual prompts are less reliable.
242
- - The vocoder is a major quality bottleneck.
243
- - It is not a voice cloning model.
244
- - It is not multilingual.
245
- - It is not suitable for safety-critical or production accessibility use.
246
-
247
- ## Recommended Framing
248
-
249
- Use this as:
250
-
251
- > An experimental 4.63M-parameter English TTS model exploring the quality/size tradeoff for ultra-small local speech synthesis.
252
 
253
- Do not present it as SOTA or production-quality.
254
 
255
  ## License
256
 
257
  Apache-2.0.
258
 
259
- This repository includes a small third-party English text frontend derived from TinyTTS-style code for tokenization/G2P compatibility. Its license is included as `TINY_TTS_LICENSE`.
 
16
  ---
17
 
18
  <p align="center">
19
+ <img src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/assets/inflect-nano-banner.png" alt="Inflect-Nano banner" width="100%">
20
  </p>
21
 
22
  # Inflect-Nano-v1
23
 
24
+ **Inflect-Nano-v1 is a tiny English text-to-speech model with 4.63M total inference parameters, including its vocoder.**
25
 
26
+ It is not trying to beat large TTS models. It is a small, local, complete text-to-waveform stack built to test how far ultra-lightweight speech synthesis can go.
27
 
28
+ ## Highlights
29
 
30
+ - **4.63M parameters total**
31
+ - **Includes the vocoder**
32
+ - **24 kHz audio**
33
+ - **Single English male voice**
34
+ - **Runs locally with PyTorch**
35
+ - Built for tiny-model experiments, local assistants, embedded demos, and efficient inference research
36
 
37
+ ## Listen
38
 
39
+ | Text | Audio |
 
 
40
  |---|---|
41
  | "Did the timing change?" she answered. "Then why did Logan leave?" | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_01.wav"></audio> |
42
  | Who puts a parking meter next to an ER label? | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_02.wav"></audio> |
 
47
  | If Logan sounded uneasy, then it happened near Long Beach, and the pause has to carry that. | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_07.wav"></audio> |
48
  | The word aluminum should not steal attention from the softer ending after entrepreneur. | <audio controls preload="none" src="https://huggingface.co/owensong/Inflect-Nano-v1/resolve/main/examples/example_08.wav"></audio> |
49
 
50
+ ## Install
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
  ```bash
53
  git clone https://huggingface.co/owensong/Inflect-Nano-v1
 
55
  pip install -r requirements.txt
56
  ```
57
 
58
+ ## Generate Speech
59
 
60
  ```bash
61
+ python inference.py --text "Wait, are you actually being for real now?" --out sample.wav
 
 
62
  ```
63
 
64
  CPU:
65
 
66
  ```bash
67
+ python inference.py --device cpu --text "Please say neighborhood clearly." --out sample_cpu.wav
 
 
 
68
  ```
69
 
70
+ With simple controls:
71
 
72
  ```bash
73
  python inference.py \
74
+ --text "The appointment moved to 1:25." \
75
  --length-scale 1.03 \
76
  --pitch-scale 1.00 \
77
  --energy-scale 1.00 \
 
84
  python app.py
85
  ```
86
 
87
+ ## Model Size
 
 
88
 
89
+ | Part | Parameters |
90
+ |---|---:|
91
+ | Acoustic model | **3.465M** |
92
+ | Vocoder generator | **1.167M** |
93
+ | Total inference stack | **4.632M** |
94
 
95
+ The model files are:
96
 
97
  ```text
98
  weights/inflect_nano_v1_acoustic.pt
99
  weights/inflect_nano_v1_vocoder.pt
100
  ```
101
 
102
+ ## What Makes It Different
103
 
104
+ Many small TTS projects depend on a separate larger vocoder. Inflect-Nano-v1 includes the vocoder in the published inference stack, so the full text-to-waveform path stays under 5M parameters.
105
+
106
+ Pipeline:
107
 
108
  ```text
109
+ text
110
+ -> English text frontend
111
+ -> compact FastSpeech-style acoustic model
112
+ -> 80-bin mel spectrogram
113
+ -> small Snake HiFi-GAN-style vocoder
114
+ -> 24 kHz waveform
115
  ```
116
 
117
+ ## Architecture
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
+ The acoustic model is a compact non-autoregressive FastSpeech-style network. It predicts duration, pitch, energy, and brightness, then decodes an 80-bin mel spectrogram.
120
 
121
+ The vocoder is a small Snake-activation HiFi-GAN-style generator trained for 24 kHz waveform reconstruction.
 
 
 
 
 
 
 
 
122
 
123
+ Main settings:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
 
125
+ | Setting | Value |
126
+ |---|---:|
127
+ | Sample rate | 24 kHz |
128
+ | Mel bins | 80 |
129
+ | Acoustic hidden size | 168 |
130
+ | Encoder layers | 5 |
131
+ | Decoder layers | 6 |
132
+ | Vocoder upsample rates | 8, 8, 2, 2 |
133
 
134
+ ## Good For
135
 
136
  - Tiny local TTS experiments
137
  - Offline assistant prototypes
 
138
  - Efficient inference research
139
+ - Embedded speech demos
140
  - Browser/WASM-style exploration
141
+ - A baseline for sub-5M TTS work
142
 
143
+ ## Not Good For
144
 
145
  - Production narration
146
  - Accessibility-critical output
147
  - Voice cloning
148
+ - Multilingual speech
149
+ - High-fidelity audiobook generation
150
+ - Matching large modern TTS systems
151
 
152
  ## Limitations
153
 
154
+ This is a very small experimental model. It can sound robotic, buzzy, or unstable, especially on difficult unseen text. Long prompts and unusual phrasing are less reliable. The vocoder is also a clear quality bottleneck.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
 
156
+ Use it as a tiny-model research/demo release, not as a production TTS engine.
157
 
158
  ## License
159
 
160
  Apache-2.0.
161
 
162
+ This repository includes a small third-party English text frontend for tokenization/G2P compatibility. Its license is included as `TINY_TTS_LICENSE`.
assets/inflect-nano-banner.png ADDED

Git LFS Details

  • SHA256: 78e68775307d45a865cc9cac0ec538ee2f0d595ae4e531644480ff9c14d92af9
  • Pointer size: 132 Bytes
  • Size of remote file: 3.06 MB