diff --git a/README.md b/README.md index 812895d..71fd678 100644 --- a/README.md +++ b/README.md @@ -8,45 +8,30 @@ tags: - speech-synthesis - pytorch - ultra-small -- tiny-tts - local-tts +- efficient-inference - experimental pipeline_tag: text-to-speech library_name: pytorch --- +
+
+
+ 4.632M total params | 3.465M acoustic | 1.167M vocoder | 24 kHz | English +
-- **4.63M total inference parameters** -- **Includes the vocoder**, not just a front-end acoustic model -- English-only single-voice speech synthesis -- 24 kHz waveform output -- Compact non-autoregressive acoustic model -- Small Snake-activation HiFi-GAN-style vocoder -- Designed for local/offline experiments and tiny-model research - -## Quick Facts - -| Item | Value | -|---|---:| -| Total inference parameters | **4.632M** | -| Acoustic model | **3.465M** | -| Vocoder generator | **1.167M** | -| Language | English | -| Voice | single male voice | -| Sample rate | 24 kHz | -| Acoustic output | 80-bin mel spectrogram | -| Vocoder | Snake V2Mid HiFi-GAN-style generator | - -## Audio Examples +## Listen First These examples cover punctuation, short questions, numbers, hard words, longer phrasing, and transition-heavy prompts. @@ -61,7 +46,41 @@ These examples cover punctuation, short questions, numbers, hard words, longer p | If Logan sounded uneasy, then it happened near Long Beach, and the pause has to carry that. | | | The word aluminum should not steal attention from the softer ending after entrepreneur. | | -## Install +## Why This Exists + +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: + +```text +text -> acoustic model -> mel spectrogram -> neural vocoder -> waveform +``` + +The model is intentionally constrained: + +| Capability | Inflect-Nano-v1 | +|---|---:| +| Complete text-to-waveform stack | Yes | +| External vocoder required | No | +| Total inference parameters | **4.632M** | +| Sample rate | **24 kHz** | +| Language | English | +| Voice count | 1 | +| Voice cloning | No | +| Multilingual | No | + +## Size Context + +Approximate parameter comparison: + +| Model / class | Params | Relative to Inflect-Nano-v1 | +|---|---:|---:| +| Inflect-Nano-v1 | **4.63M** | 1.0x | +| Kokoro-82M | ~82M | ~17.7x larger | +| Chatterbox-sized TTS | ~500M | ~108x larger | +| Multi-billion TTS systems | 1B+ | 216x+ larger | + +The comparison is about model scale, not quality parity. Larger models are expected to sound better. + +## Quickstart ```bash git clone https://huggingface.co/owensong/Inflect-Nano-v1 @@ -69,9 +88,7 @@ cd Inflect-Nano-v1 pip install -r requirements.txt ``` -The text frontend may download tokenizer files on first run. - -## Usage +Generate audio: ```bash python inference.py \ @@ -79,7 +96,7 @@ python inference.py \ --out sample.wav ``` -CPU example: +CPU: ```bash python inference.py \ @@ -99,28 +116,45 @@ python inference.py \ --out sample_controlled.wav ``` -Gradio demo: +Local Gradio demo: ```bash python app.py ``` +The text frontend may download tokenizer files on first run. + +## Model Summary + +| Component | Parameters | Notes | +|---|---:|---| +| Acoustic model | **3,465,125** | Compact non-autoregressive FastSpeech-style model | +| Vocoder generator | **1,167,077** | Snake V2Mid HiFi-GAN-style generator | +| Total inference model | **4,632,202** | Acoustic + vocoder | + +Model files: + +```text +weights/inflect_nano_v1_acoustic.pt +weights/inflect_nano_v1_vocoder.pt +``` + ## Architecture Inflect-Nano-v1 is a two-part TTS stack: ```text -text --> normalization + English G2P frontend --> compact FastSpeech-style acoustic model --> 80-bin mel spectrogram --> Snake V2Mid HiFi-GAN-style vocoder --> 24 kHz waveform +Text + -> English normalization + G2P frontend + -> Compact FastSpeech-style acoustic model + -> 80-bin mel spectrogram + -> Snake V2Mid HiFi-GAN-style vocoder + -> 24 kHz waveform ``` ### Acoustic Model -The acoustic model is a compact non-autoregressive FastSpeech-style network. It predicts duration, energy, brightness, and pitch, expands token states into frame states, and decodes 80-bin mel spectrograms. +The acoustic model predicts duration, energy, brightness, and pitch, expands token states into frame states, and decodes 80-bin mel spectrograms. Main config: @@ -156,7 +190,7 @@ heads/embeds/projections: remainder ### Vocoder -The vocoder is a custom Snake-activation HiFi-GAN-style generator. +The vocoder is a custom Snake-activation HiFi-GAN-style generator. Discriminators are training-only and are not included in inference parameter counts. Main config: @@ -178,14 +212,25 @@ Main config: } ``` -Discriminators are training-only and are not included in inference parameter counts. +## Intended Use -## Model Files +Good fits: -```text -weights/inflect_nano_v1_acoustic.pt -weights/inflect_nano_v1_vocoder.pt -``` +- Tiny local TTS experiments +- Offline assistant prototypes +- Embedded or low-resource speech demos +- Efficient inference research +- Browser/WASM-style exploration +- Baseline for sub-5M TTS work + +Poor fits: + +- Production narration +- Accessibility-critical output +- Voice cloning +- Multilingual TTS +- High-fidelity studio speech +- Long-form audiobook generation ## Limitations @@ -194,9 +239,10 @@ This model is intentionally tiny and has clear quality limits: - Unseen text can stumble or sound unstable. - The voice can sound robotic, buzzy, or artifacted. - Long or unusual prompts are less reliable. +- The vocoder is a major quality bottleneck. - It is not a voice cloning model. - It is not multilingual. -- It is not suitable for production accessibility, safety, or high-quality narration use. +- It is not suitable for safety-critical or production accessibility use. ## Recommended Framing diff --git a/assets/inflect-nano-banner.svg b/assets/inflect-nano-banner.svg new file mode 100644 index 0000000..92283d2 --- /dev/null +++ b/assets/inflect-nano-banner.svg @@ -0,0 +1,73 @@ + diff --git a/tiny_tts/__pycache__/__init__.cpython-312.pyc b/tiny_tts/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..79337d7 Binary files /dev/null and b/tiny_tts/__pycache__/__init__.cpython-312.pyc differ diff --git a/tiny_tts/__pycache__/infer.cpython-312.pyc b/tiny_tts/__pycache__/infer.cpython-312.pyc new file mode 100644 index 0000000..2fc34e8 Binary files /dev/null and b/tiny_tts/__pycache__/infer.cpython-312.pyc differ diff --git a/tiny_tts/alignment/__pycache__/__init__.cpython-312.pyc b/tiny_tts/alignment/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..43b11b5 Binary files /dev/null and b/tiny_tts/alignment/__pycache__/__init__.cpython-312.pyc differ diff --git a/tiny_tts/alignment/__pycache__/core.cpython-312.pyc b/tiny_tts/alignment/__pycache__/core.cpython-312.pyc new file mode 100644 index 0000000..22409f2 Binary files /dev/null and b/tiny_tts/alignment/__pycache__/core.cpython-312.pyc differ diff --git a/tiny_tts/models/__pycache__/__init__.cpython-312.pyc b/tiny_tts/models/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..c84a6c7 Binary files /dev/null and b/tiny_tts/models/__pycache__/__init__.cpython-312.pyc differ diff --git a/tiny_tts/models/__pycache__/synthesizer.cpython-312.pyc b/tiny_tts/models/__pycache__/synthesizer.cpython-312.pyc new file mode 100644 index 0000000..07e1832 Binary files /dev/null and b/tiny_tts/models/__pycache__/synthesizer.cpython-312.pyc differ diff --git a/tiny_tts/nn/__pycache__/__init__.cpython-312.pyc b/tiny_tts/nn/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..50e39a0 Binary files /dev/null and b/tiny_tts/nn/__pycache__/__init__.cpython-312.pyc differ diff --git a/tiny_tts/nn/__pycache__/attentions.cpython-312.pyc b/tiny_tts/nn/__pycache__/attentions.cpython-312.pyc new file mode 100644 index 0000000..78d0d14 Binary files /dev/null and b/tiny_tts/nn/__pycache__/attentions.cpython-312.pyc differ diff --git a/tiny_tts/nn/__pycache__/commons.cpython-312.pyc b/tiny_tts/nn/__pycache__/commons.cpython-312.pyc new file mode 100644 index 0000000..940015b Binary files /dev/null and b/tiny_tts/nn/__pycache__/commons.cpython-312.pyc differ diff --git a/tiny_tts/nn/__pycache__/modules.cpython-312.pyc b/tiny_tts/nn/__pycache__/modules.cpython-312.pyc new file mode 100644 index 0000000..21decbb Binary files /dev/null and b/tiny_tts/nn/__pycache__/modules.cpython-312.pyc differ diff --git a/tiny_tts/nn/__pycache__/transforms.cpython-312.pyc b/tiny_tts/nn/__pycache__/transforms.cpython-312.pyc new file mode 100644 index 0000000..1640f7b Binary files /dev/null and b/tiny_tts/nn/__pycache__/transforms.cpython-312.pyc differ diff --git a/tiny_tts/text/__pycache__/__init__.cpython-312.pyc b/tiny_tts/text/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..3753cb5 Binary files /dev/null and b/tiny_tts/text/__pycache__/__init__.cpython-312.pyc differ diff --git a/tiny_tts/text/__pycache__/english.cpython-312.pyc b/tiny_tts/text/__pycache__/english.cpython-312.pyc new file mode 100644 index 0000000..68f6ba9 Binary files /dev/null and b/tiny_tts/text/__pycache__/english.cpython-312.pyc differ diff --git a/tiny_tts/text/__pycache__/symbols.cpython-312.pyc b/tiny_tts/text/__pycache__/symbols.cpython-312.pyc new file mode 100644 index 0000000..79602ef Binary files /dev/null and b/tiny_tts/text/__pycache__/symbols.cpython-312.pyc differ diff --git a/tiny_tts/text/english_utils/__pycache__/__init__.cpython-312.pyc b/tiny_tts/text/english_utils/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..f6a092e Binary files /dev/null and b/tiny_tts/text/english_utils/__pycache__/__init__.cpython-312.pyc differ diff --git a/tiny_tts/text/english_utils/__pycache__/abbreviations.cpython-312.pyc b/tiny_tts/text/english_utils/__pycache__/abbreviations.cpython-312.pyc new file mode 100644 index 0000000..fd0f9f6 Binary files /dev/null and b/tiny_tts/text/english_utils/__pycache__/abbreviations.cpython-312.pyc differ diff --git a/tiny_tts/text/english_utils/__pycache__/number_norm.cpython-312.pyc b/tiny_tts/text/english_utils/__pycache__/number_norm.cpython-312.pyc new file mode 100644 index 0000000..c2109e3 Binary files /dev/null and b/tiny_tts/text/english_utils/__pycache__/number_norm.cpython-312.pyc differ diff --git a/tiny_tts/text/english_utils/__pycache__/time_norm.cpython-312.pyc b/tiny_tts/text/english_utils/__pycache__/time_norm.cpython-312.pyc new file mode 100644 index 0000000..3a47290 Binary files /dev/null and b/tiny_tts/text/english_utils/__pycache__/time_norm.cpython-312.pyc differ diff --git a/tiny_tts/utils/__pycache__/__init__.cpython-312.pyc b/tiny_tts/utils/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000..a239223 Binary files /dev/null and b/tiny_tts/utils/__pycache__/__init__.cpython-312.pyc differ diff --git a/tiny_tts/utils/__pycache__/config.cpython-312.pyc b/tiny_tts/utils/__pycache__/config.cpython-312.pyc new file mode 100644 index 0000000..0d626ad Binary files /dev/null and b/tiny_tts/utils/__pycache__/config.cpython-312.pyc differ