Views
No views yet
⚠️ Labeled preview — FP32, CPU. Arbitrary free text → speech (not a single baked sentence). The neural graphs are LiteRT.tflite; two small steps run host-side (the hn-NSF source STFT and the final iSTFT overlap-add). GPU + quantization are the next steps.
.tflite) conversion of
hexgrad/Kokoro-82M (StyleTTS2 + ISTFTNet) for
on-device free-text text-to-speech (arbitrary text in, 24 kHz speech out). Audio fidelity
≈ 0.9994 magnitude-spectrogram correlation to the PyTorch reference (verified across multiple
held-out sentences, not just the export sample).L = sum(pred_dur)),
which litert_torch cannot keep dynamic (the LSTM sequence axis specializes). It is therefore
split into three fixed-bucket bundles with host steps between them, so arbitrary text works
by left-padding to the bucket and trimming the output (longer text is split into sentences
host-side, each ≤ the bucket):text --(G2P, host)--> phoneme ids
1. kokoro_predictor.tflite : ids[1,128], ref_s[1,256], attn[1,128] -> duration, d, t_en
host: pred_dur = round(duration); alignment one-hot aln[1,128,512]; frame_mask[1,512]
2. kokoro_prosody.tflite : d, t_en, aln, ref_s, frame_mask -> asr, F0, N
host: har = STFT(SineGen(f0_upsamp(F0))) (the hn-NSF excitation)
3. kokoro_vocoder.tflite : asr, F0, N, har, ref_s, frame_mask -> spec, phase
host: iSTFT overlap-add(spec, phase) -> 24 kHz waveform; trim to L*600| File | Precision | Size | Role |
|---|---|---|---|
kokoro_predictor.tflite | fp32 | ~91 MB | PL-BERT + duration/text encoders (masked unrolled bi-LSTMs) |
kokoro_prosody.tflite | fp32 | ~37 MB | shared prosody LSTM + F0/N (masked) |
kokoro_vocoder.tflite | fp32 | ~236 MB | iSTFTNet decoder → magnitude/phase spectrogram |
istft_Wr_f32.bin, istft_Wi_f32.bin | fp32 | 880 B each | inverse-DFT bases for the host-side iSTFT |
T = 128, frame bucket L = 512 (≈ 12.8 s of audio per chunk at 24 kHz).
Bundles are voice-independent — the voice is the ref_s input (a voices/*.pt from the
base repo, indexed by token-sequence length).| Task | Text-to-speech (English), free text, 24 kHz mono |
| Source | hexgrad/Kokoro-82M (StyleTTS2 + ISTFTNet) |
| Fidelity | magspec-corr 0.9994 vs PyTorch (waveform corr ≈ 0.98 — the bounded bucket pad-boundary effect; the spectrum is what's perceived) |
| Runtime | CPU (LiteRT CompiledModel API) |
litert_torch), general path — Kokoro is StyleTTS2/ISTFTNet, not a transformer LLM, so the Generative-API re-authoring path does not apply.nn.LSTM leaks pad tokens into the backward pass and wrecks prosody); the 58 AdaIN InstanceNorms normalize over real frames only so bucket pad frames don't poison the statistics; the hn-NSF source STFT runs host-side (its atan2 phase flips at the F0→0 pad boundary on-device).tnc CC BY 3.0, SIWIS CC BY 4.0), and synthetic audio from large-provider TTS — paired with IPA phoneme labels. No proprietary or scraped personal recordings, no custom voice clones. This LiteRT artifact is a format conversion of the released weights and introduces no additional training data.EQUAL/SELECT keep it on CPU; decomposing attention to ≤4-D would let it ride the GPU delegate. In-graph iSTFT on GPU additionally needs an FFT kernel in the LiteRT GPU delegate (ML Drift).