Kokoro-82M Core ML
Fixed-shape Core ML packages converted from
hexgrad/Kokoro-82M snapshot
f3ff3571. They were graded on a physical iPhone 12 (A14, 4 GB).
The conversion source is the PyTorch checkpoint. The public Kokoro ONNX model is the listening reference. Kokoro weights stay Apache-2.0. This repository does not include the original checkpoint, the ONNX file, or a phonemizer.
Conversion scripts, the iPhone benchmark, frozen inputs, and the raw result JSON are in the GitHub repository:
github.com/qmohitsingh/kokoro-82m-coreml
Graded on iPhone 12
Voice af_heart, speed 1.0, iOS 18, Core ML compute units .all. Two warm-ups
were discarded, then the median of 10 runs. The phonemizer is outside the
timer: token ids and a style row go in, and a 24 kHz waveform comes out.
| Passage | Median RTF | Samples matched | Thermal state |
|---|---|---|---|
| 3 s | 0.193 | yes | serious |
| 7 s | 0.202 | yes | serious |
| 15 s | 0.220 | yes | serious |
| 30 s | 0.252 | yes | serious |
RTF is wall seconds divided by audio seconds. The 30 second passage is two model calls joined together. Its slowest scored run was 0.300.
A blind comparison against the ONNX reference was four ties. The reference was not preferred on any passage. A continuous Core ML loop then ran for 3,606 seconds and 316 loops without a crash.
Packages
Each passage has five fp32 packages. The same weights are stored again for every length, so a download of all 25 packages is about 1.5 GB.
| Passage | Tokens | Frames | Audio | Package suffix |
|---|---|---|---|---|
| 3 s | 56 | 146 | 3.650 s | t56 and f146 |
| 7 s | 110 | 275 | 6.875 s | t110 and f275 |
| 15 s | 237 | 567 | 14.175 s | t237 and f567 |
| 30 s, first call | 260 | 614 | 15.350 s | t260 and f614 |
| 30 s, second call | 280 | 633 | 15.825 s | t280 and f633 |
The five stages are:
| Package | Inputs | Outputs |
|---|---|---|
kokoro_text_t*_fp32 |
input_ids |
encoded |
kokoro_prosody_text_t*_fp32 |
input_ids, encoded, style |
duration_hidden, duration_logits, text_features |
kokoro_pitch_energy_f*_fp32 |
aligned, style |
pitch, energy |
kokoro_decoder_body_f*_fp32 |
text, pitch, energy, style |
features |
kokoro_generator_f*_fp32 |
features, style, spectrum |
magnitude, phase |
style is the 256-value voice row. Pitch and energy use the prosody half.
The decoder body and generator use the timbre half. A package only accepts the
token count or frame count in its name.
Swift, in the iPhone benchmark, repeats each token by its rounded duration, builds the harmonic source, and turns magnitude and phase back into audio. Those steps are not inside these packages.
Download one passage
The 3 second set is the five packages ending in t56 or f146:
hf download qmohits/kokoro-82m-coreml \
--include "kokoro_text_t56_fp32.mlpackage/**" \
--include "kokoro_prosody_text_t56_fp32.mlpackage/**" \
--include "kokoro_pitch_energy_f146_fp32.mlpackage/**" \
--include "kokoro_decoder_body_f146_fp32.mlpackage/**" \
--include "kokoro_generator_f146_fp32.mlpackage/**"
Limits
These graphs are fixed at conversion time. A different sentence length needs a new pair of shapes. One call cannot cover the full 30 second passage, because the phoneme cap is 510. The benchmark app is about 1.9 GB for the same reason the packages repeat their weights.
- Downloads last month
- 300