Views
No views yet
pred_dur)pred_dur.kokoro package surfaces these durations as token timestamps; the
stock ONNX export simply doesn't list the tensor as a graph output, so web
runtimes (kokoro-js / transformers.js) never see it. Exposing it enables
sample-accurate word timing (karaoke, RSVP, captions) with zero extra
inference cost.onnx package — no re-export, no re-quantization:
the tensor /encoder/Clip_output_0 (the rounded, min-clamped per-token frame
count that feeds the alignment CumSum) is aliased through a Cast-to-float32
node to a new graph output pred_dur, shape [1, num_input_tokens]. The Cast
keeps the output float32 on every precision tier (the fp16 tiers carry it as
float16 internally, which browsers can't reliably read); the values are small
integer frame counts, so the cast is exact.
The waveform output is bit-identical to the stock export (verified for
every patched file).onnx/model.onnx (fp32), onnx/model_quantized.onnx (q8),
onnx/model_q4.onnx, onnx/model_q4f16.onnx. The remaining variants
(fp16, q8f16, uint8, uint8f16) are unmodified copies from the base repo.audio.length / sum(pred_dur) is the
samples-per-frame at runtime.1const out = await model({ input_ids, style, speed }); // transformers.js
2out.waveform; // identical to the stock model
3out.pred_dur; // [1, T] frames per input token — cumulative sum = token start timesexport_timestamps.py
(in the Aloud repo, which uses this model for its neural karaoke).