Refresh model card and examples
This commit is contained in:
@@ -7,7 +7,9 @@ tags:
|
||||
- tts
|
||||
- speech-synthesis
|
||||
- pytorch
|
||||
- ultra-small
|
||||
- tiny-tts
|
||||
- local-tts
|
||||
- experimental
|
||||
pipeline_tag: text-to-speech
|
||||
library_name: pytorch
|
||||
@@ -15,9 +17,21 @@ library_name: pytorch
|
||||
|
||||
# Inflect-Nano-v1
|
||||
|
||||
Inflect-Nano-v1 is an experimental ultra-small English TTS stack. It is built to test how far a sub-5M-parameter text-to-speech system can be pushed with a compact non-autoregressive acoustic model and a small neural vocoder.
|
||||
Inflect-Nano-v1 is an **ultra-small English text-to-speech model** with only **4.63M inference parameters total**. That includes both the acoustic model and the neural vocoder.
|
||||
|
||||
This is **not** a production-quality or SOTA TTS model. It is a research/demo release: small, local, and runnable, but still audibly limited.
|
||||
The goal is simple: explore how far a truly tiny, fully local TTS stack can be pushed while staying small enough to run in places where normal TTS models are too large. It is one of the smallest neural TTS releases in this class, sitting far below the size of most modern speech synthesis systems.
|
||||
|
||||
This is an experimental release, not a production or SOTA voice model. It is small, fast to load, and usable for demos, but it still has audible quality limits.
|
||||
|
||||
## Why It Is Notable
|
||||
|
||||
- **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
|
||||
|
||||
@@ -27,26 +41,25 @@ This is **not** a production-quality or SOTA TTS model. It is a research/demo re
|
||||
| Acoustic model | **3.465M** |
|
||||
| Vocoder generator | **1.167M** |
|
||||
| Language | English |
|
||||
| Voice | single Mark-style synthetic male voice |
|
||||
| Voice | single male voice |
|
||||
| Sample rate | 24 kHz |
|
||||
| Acoustic output | 80-bin mel spectrogram |
|
||||
| Vocoder | custom Snake-activation HiFi-GAN-style generator |
|
||||
| Training source | synthetic Qwen3-TTS Mark-style teacher data |
|
||||
| Vocoder | Snake V2Mid HiFi-GAN-style generator |
|
||||
|
||||
## Audio Examples
|
||||
|
||||
These are unseen/OOD stress prompts, not hand-picked training rows.
|
||||
These examples cover punctuation, short questions, numbers, hard words, longer phrasing, and transition-heavy prompts.
|
||||
|
||||
| Prompt | Audio |
|
||||
|---|---|
|
||||
| Wait, are you actually being for real now? I can't believe it! | <audio controls src="examples/example_01.wav"></audio> |
|
||||
| Sophia sent me 43 pictures of her doing stuff... interesting. | <audio controls src="examples/example_02.wav"></audio> |
|
||||
| Please say chrysanthemum, thoroughly, proprietary, and rural without rushing through the middle syllables. | <audio controls src="examples/example_03.wav"></audio> |
|
||||
| No, seriously, did Jordan leave the receipt in Albuquerque, or did Priya move it to Worcester? | <audio controls src="examples/example_04.wav"></audio> |
|
||||
| The Wi-Fi password is Q7-Delta-9921, but please do not say the dash like a minus sign. | <audio controls src="examples/example_05.wav"></audio> |
|
||||
| I appreciate the honesty, but that explanation sounded weirdly dramatic for a Tuesday morning. | <audio controls src="examples/example_06.wav"></audio> |
|
||||
| Could you whisper the first part, then brighten up when you say, 'we finally solved it'? | <audio controls src="examples/example_07.wav"></audio> |
|
||||
| The dermatologist, the anesthesiologist, and the statistician all disagreed about February. | <audio controls src="examples/example_08.wav"></audio> |
|
||||
| "Did the timing change?" she answered. "Then why did Logan leave?" | [example_01.wav](./examples/example_01.wav) |
|
||||
| Who puts a parking meter next to an ER label? | [example_02.wav](./examples/example_02.wav) |
|
||||
| Please say neighborhood, statistics, and anesthesiologist clearly, without rushing through the middle syllables. | [example_03.wav](./examples/example_03.wav) |
|
||||
| I said 91, not 306, which is a very different number. | [example_04.wav](./examples/example_04.wav) |
|
||||
| The inference path looked natural, but the decoder still needed a smoother transition before Marcus approved the final test. | [example_05.wav](./examples/example_05.wav) |
|
||||
| The appointment moved to 1:25, the invoice was $674.96, and the archive was labeled 1998. | [example_06.wav](./examples/example_06.wav) |
|
||||
| If Logan sounded uneasy, then it happened near Long Beach, and the pause has to carry that. | [example_07.wav](./examples/example_07.wav) |
|
||||
| The word aluminum should not steal attention from the softer ending after entrepreneur. | [example_08.wav](./examples/example_08.wav) |
|
||||
|
||||
## Install
|
||||
|
||||
@@ -56,7 +69,7 @@ cd Inflect-Nano-v1
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
|
||||
The text frontend uses TinyTTS-style English G2P and may download `bert-base-uncased` tokenizer files on first run.
|
||||
The text frontend may download tokenizer files on first run.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -71,7 +84,7 @@ CPU example:
|
||||
```bash
|
||||
python inference.py \
|
||||
--device cpu \
|
||||
--text "Please say chrysanthemum, thoroughly, proprietary, and rural clearly." \
|
||||
--text "Please say neighborhood, statistics, and anesthesiologist clearly." \
|
||||
--out sample_cpu.wav
|
||||
```
|
||||
|
||||
@@ -98,7 +111,7 @@ Inflect-Nano-v1 is a two-part TTS stack:
|
||||
|
||||
```text
|
||||
text
|
||||
-> TinyTTS-style normalization + G2P phoneme/tone/lang IDs
|
||||
-> normalization + English G2P frontend
|
||||
-> compact FastSpeech-style acoustic model
|
||||
-> 80-bin mel spectrogram
|
||||
-> Snake V2Mid HiFi-GAN-style vocoder
|
||||
@@ -107,7 +120,7 @@ text
|
||||
|
||||
### Acoustic Model
|
||||
|
||||
The acoustic model is a small non-autoregressive FastSpeech-style network. It predicts duration, energy, brightness, and pitch, then expands token states into frame states and decodes mels.
|
||||
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.
|
||||
|
||||
Main config:
|
||||
|
||||
@@ -129,7 +142,7 @@ Main config:
|
||||
}
|
||||
```
|
||||
|
||||
Acoustic parameter split:
|
||||
Approximate acoustic split:
|
||||
|
||||
```text
|
||||
total acoustic: 3.465M
|
||||
@@ -165,61 +178,9 @@ Main config:
|
||||
}
|
||||
```
|
||||
|
||||
The vocoder was trained with HiFi-GAN-style adversarial losses and multi-resolution spectral pressure. Discriminators are training-only and are not included in inference.
|
||||
Discriminators are training-only and are not included in inference parameter counts.
|
||||
|
||||
## Training Data
|
||||
|
||||
The final acoustic model was trained primarily on synthetic Mark-style teacher speech.
|
||||
|
||||
Known final broad training mix:
|
||||
|
||||
```text
|
||||
mixed_80k_v2_40_v1_20_old_20
|
||||
rows: 80,000
|
||||
estimated duration: ~125.2 hours
|
||||
composition:
|
||||
40k newer generalization v2 examples
|
||||
20k generalization v1 examples
|
||||
20k older Mark anchor examples
|
||||
```
|
||||
|
||||
The practical release voice is one speaker:
|
||||
|
||||
```text
|
||||
qwen3_mark
|
||||
```
|
||||
|
||||
## Training Recipe
|
||||
|
||||
The final F checkpoint is a staged recovery candidate, not a single monolithic run.
|
||||
|
||||
High-level acoustic lineage:
|
||||
|
||||
```text
|
||||
1. Mark-focused acoustic base
|
||||
2. mixed 80k generalization training
|
||||
3. predictor-exposure heads training
|
||||
4. robust prosody bridge
|
||||
5. recovery phases A/B/C
|
||||
6. short predictor-tail cleanup
|
||||
```
|
||||
|
||||
Known acoustic continuation after the earlier Mark base:
|
||||
|
||||
```text
|
||||
mixed80k broad training: ~32k selected checkpoint
|
||||
predictor exposure: 9k steps
|
||||
robust prosody bridge: 1.2k steps
|
||||
recovery phase A: 3k steps
|
||||
recovery phase B: 3k steps
|
||||
recovery phase C: 2.5k steps
|
||||
predictor tail: 0.8k steps
|
||||
known continuation total: ~51.5k steps
|
||||
```
|
||||
|
||||
Acoustic losses included mel reconstruction, MSE, delta/acceleration losses, duration loss, energy loss, brightness loss, pitch loss, predicted-prosody exposure, and robust-prosody exposure.
|
||||
|
||||
Final selected files in this repo:
|
||||
## Model Files
|
||||
|
||||
```text
|
||||
weights/inflect_nano_v1_acoustic.pt
|
||||
@@ -233,7 +194,6 @@ 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.
|
||||
- It inherits habits from synthetic Qwen3-TTS teacher data.
|
||||
- It is not a voice cloning model.
|
||||
- It is not multilingual.
|
||||
- It is not suitable for production accessibility, safety, or high-quality narration use.
|
||||
@@ -248,4 +208,6 @@ Do not present it as SOTA or production-quality.
|
||||
|
||||
## License
|
||||
|
||||
Apache-2.0. The repo includes TinyTTS text frontend code; its license is included as `TINY_TTS_LICENSE`.
|
||||
Apache-2.0.
|
||||
|
||||
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`.
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+50
-58
@@ -1,58 +1,50 @@
|
||||
[
|
||||
{
|
||||
"id": "example_01",
|
||||
"text": "Wait, are you actually being for real now? I can't believe it!",
|
||||
"file": "examples/example_01.wav",
|
||||
"seconds": 3.296,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
},
|
||||
{
|
||||
"id": "example_02",
|
||||
"text": "Sophia sent me 43 pictures of her doing stuff... interesting.",
|
||||
"file": "examples/example_02.wav",
|
||||
"seconds": 3.104,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
},
|
||||
{
|
||||
"id": "example_03",
|
||||
"text": "Please say chrysanthemum, thoroughly, proprietary, and rural without rushing through the middle syllables.",
|
||||
"file": "examples/example_03.wav",
|
||||
"seconds": 5.045333333333334,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
},
|
||||
{
|
||||
"id": "example_04",
|
||||
"text": "No, seriously, did Jordan leave the receipt in Albuquerque, or did Priya move it to Worcester?",
|
||||
"file": "examples/example_04.wav",
|
||||
"seconds": 4.949333333333334,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
},
|
||||
{
|
||||
"id": "example_05",
|
||||
"text": "The Wi-Fi password is Q7-Delta-9921, but please do not say the dash like a minus sign.",
|
||||
"file": "examples/example_05.wav",
|
||||
"seconds": 5.941333333333334,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
},
|
||||
{
|
||||
"id": "example_06",
|
||||
"text": "I appreciate the honesty, but that explanation sounded weirdly dramatic for a Tuesday morning.",
|
||||
"file": "examples/example_06.wav",
|
||||
"seconds": 4.693333333333333,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
},
|
||||
{
|
||||
"id": "example_07",
|
||||
"text": "Could you whisper the first part, then brighten up when you say, 'we finally solved it'?",
|
||||
"file": "examples/example_07.wav",
|
||||
"seconds": 4.373333333333333,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
},
|
||||
{
|
||||
"id": "example_08",
|
||||
"text": "The dermatologist, the anesthesiologist, and the statistician all disagreed about February.",
|
||||
"file": "examples/example_08.wav",
|
||||
"seconds": 4.8853333333333335,
|
||||
"source_gallery": "INFLECT_MICRO_5M_OOD_STRESS_CANDIDATES_V1/F_RECOVERY_FINAL"
|
||||
}
|
||||
]
|
||||
[
|
||||
{
|
||||
"id": "example_01",
|
||||
"text": "\"Did the timing change?\" she answered. \"Then why did Logan leave?\"",
|
||||
"file": "examples/example_01.wav",
|
||||
"seconds": 3.168
|
||||
},
|
||||
{
|
||||
"id": "example_02",
|
||||
"text": "Who puts a parking meter next to an ER label?",
|
||||
"file": "examples/example_02.wav",
|
||||
"seconds": 2.112
|
||||
},
|
||||
{
|
||||
"id": "example_03",
|
||||
"text": "Please say neighborhood, statistics, and anesthesiologist clearly, without rushing through the middle syllables.",
|
||||
"file": "examples/example_03.wav",
|
||||
"seconds": 5.536
|
||||
},
|
||||
{
|
||||
"id": "example_04",
|
||||
"text": "I said 91, not 306, which is a very different number.",
|
||||
"file": "examples/example_04.wav",
|
||||
"seconds": 3.5946666666666665
|
||||
},
|
||||
{
|
||||
"id": "example_05",
|
||||
"text": "The inference path looked natural, but the decoder still needed a smoother transition before Marcus approved the final test.",
|
||||
"file": "examples/example_05.wav",
|
||||
"seconds": 6.026666666666666
|
||||
},
|
||||
{
|
||||
"id": "example_06",
|
||||
"text": "The appointment moved to 1:25, the invoice was $674.96, and the archive was labeled 1998.",
|
||||
"file": "examples/example_06.wav",
|
||||
"seconds": 7.1786666666666665
|
||||
},
|
||||
{
|
||||
"id": "example_07",
|
||||
"text": "If Logan sounded uneasy, then it happened near Long Beach, and the pause has to carry that.",
|
||||
"file": "examples/example_07.wav",
|
||||
"seconds": 4.458666666666667
|
||||
},
|
||||
{
|
||||
"id": "example_08",
|
||||
"text": "The word aluminum should not steal attention from the softer ending after entrepreneur.",
|
||||
"file": "examples/example_08.wav",
|
||||
"seconds": 3.968
|
||||
}
|
||||
]
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ def load_acoustic(path: Path, device: torch.device) -> tuple[MicroFastSpeech, di
|
||||
model.load_state_dict(ckpt["model"])
|
||||
model.eval()
|
||||
params = int(ckpt.get("params") or sum(p.numel() for p in model.parameters()))
|
||||
return model, ckpt.get("speakers") or {"qwen3_mark": 0}, params
|
||||
return model, ckpt.get("speakers") or {"mark": 0}, params
|
||||
|
||||
|
||||
def load_vocoder(path: Path, device: torch.device) -> tuple[HifiGanGenerator, int]:
|
||||
@@ -91,7 +91,7 @@ def synthesize(
|
||||
phone = phone.unsqueeze(0).to(device)
|
||||
tone = tone.unsqueeze(0).to(device)
|
||||
lang = lang.unsqueeze(0).to(device)
|
||||
speaker = torch.LongTensor([int(speakers.get("qwen3_mark", 0))]).to(device)
|
||||
speaker = torch.LongTensor([int(speakers.get("mark", next(iter(speakers.values()), 0)))]).to(device)
|
||||
mel = acoustic.infer(
|
||||
phone,
|
||||
tone,
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"model_name": "Inflect-Nano-v1",
|
||||
"language": "English",
|
||||
"speaker": "qwen3_mark",
|
||||
"speaker": "mark",
|
||||
"sample_rate": 24000,
|
||||
"n_mels": 80,
|
||||
"acoustic_params": 3465125,
|
||||
@@ -73,6 +73,6 @@
|
||||
],
|
||||
"activation": "snake"
|
||||
},
|
||||
"acoustic_checkpoint": "D:\\Inflect-Storage\\Inflect-New-offload\\outputs\\inflect_micro_fastspeech_v10_curriculum\\mark_generalization_v2\\overnight_recovery_v1\\phaseD_predictor_tail_800\\inflect-micro-fastspeech-800.pt",
|
||||
"vocoder_checkpoint": "D:\\Inflect-Storage\\Inflect-New-offload\\outputs\\hifigan_oracle_v1\\snake_v2mid_final_polish_v1\\hifigan-snake_v2mid-165000.pt"
|
||||
}
|
||||
"acoustic_checkpoint": "weights/inflect_nano_v1_acoustic.pt",
|
||||
"vocoder_checkpoint": "weights/inflect_nano_v1_vocoder.pt"
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -881,7 +881,7 @@ def save_checkpoint(path: Path, model: nn.Module, optim, cfg: MicroFastSpeechCon
|
||||
def train(args: argparse.Namespace) -> None:
|
||||
device = torch.device(args.device)
|
||||
rows = load_rows(args.durations_jsonl, args.max_rows)
|
||||
speakers = {voice: idx for idx, voice in enumerate(sorted({str(r.get("voice_id") or "qwen3_mark") for r in rows}))}
|
||||
speakers = {voice: idx for idx, voice in enumerate(sorted({str(r.get("voice_id") or "mark") for r in rows}))}
|
||||
max_phone_id = max(max(map(int, r["phone_ids"])) for r in rows)
|
||||
max_tone_id = max(max(map(int, r["tone_ids"])) for r in rows)
|
||||
max_lang_id = max(max(map(int, r["lang_ids"])) for r in rows)
|
||||
@@ -901,7 +901,7 @@ def train(args: argparse.Namespace) -> None:
|
||||
use_group_duration_planner=args.group_duration_planner,
|
||||
)
|
||||
for row in rows:
|
||||
row["speaker_id"] = speakers[str(row.get("voice_id") or "qwen3_mark")]
|
||||
row["speaker_id"] = speakers[str(row.get("voice_id") or "mark")]
|
||||
random.Random(args.seed).shuffle(rows)
|
||||
|
||||
model = MicroFastSpeech(cfg).to(device)
|
||||
@@ -981,7 +981,7 @@ def train(args: argparse.Namespace) -> None:
|
||||
predicted_prosody_delta_loss = torch.zeros((), device=device)
|
||||
if args.predicted_prosody_mel_weight > 0.0 or args.predicted_prosody_delta_weight > 0.0:
|
||||
# Train the predictor heads against the acoustic result they produce at
|
||||
# inference, while retaining teacher durations so this path remains
|
||||
# inference, while retaining reference durations so this path remains
|
||||
# differentiable and isolates prosody exposure bias.
|
||||
predicted_conditioning = model(phone, tone, lang, speaker, durations)
|
||||
if args.predicted_prosody_mel_weight > 0.0:
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user