Kokoro Vietnamese for the web
Browser-ready files for Vietnamese Kokoro text-to-speech, converted from contextboxai/Kokoro-Vietnamese (Apache-2.0). Runs fully client-side with onnxruntime-web (WebGPU, or WASM as a fallback).
| File | Size | What it is |
|---|---|---|
kokoro_vi.web.onnx |
83 MB | The original ONNX export, constant-folded, with every large weight stored as per-channel int8 + DequantizeLinear |
voices/<name>.bin |
510 KB each | Voice packs: raw little-endian float32, 510 ร 256 (one style vector per input length) |
Voices
diem_trinh, duc_an, duc_duy, hung_thinh, mai_linh, mai_loan, manh_dung, my_yen,
ngoc_huyen, phat_tai, storyvert, thanh_dat, thuc_trinh, tuan_ngoc.
Model I/O
input_idsint64[1, n + 2]: token ids from the 114-symbol vocab in the source repo'sconfig.json, padded with 0 at both ends (n โค 510)ref_sfloat32[1, 256]: rowmin(n, 510) - 1of the voice packspeedfloat32 scalar- output
waveformfloat32: 24 kHz mono audio
Load it with the session option session.disable_quant_qdq = "1". ONNX Runtime then folds the
int8 weights back into fp32 constants at load time: a 4ร smaller download with unchanged compute.
const session = await ort.InferenceSession.create(modelBytes, {
executionProviders: ["webgpu", "wasm"],
extra: { session: { disable_quant_qdq: "1" } },
});
Use onnxruntime-web 1.30 or newer for WebGPU; 1.22 gives wrong output on this model without raising an error.
Text must first be normalized and phonemized to Kokoro's Vietnamese IPA (tones as arrows
โ โ โ โ). The source repo uses vig2p for this.
Conversion
- Constant-fold the graph (the export computes conv weights at runtime via weight norm).
- Quantize every fp32 initializer with โฅ 4096 elements to symmetric per-output-channel int8.
- Voice packs: the raw tensor storage of each
voicepacks/<name>.pt.
Checked against the original model on CPU: same durations (e.g. 1.62 s, 8.32 s โ 8.28 s, 3.20 s on three test sentences) and near-identical spectra.
License
Apache-2.0, as the source model. All credit for training goes to the authors of contextboxai/Kokoro-Vietnamese and hexgrad/Kokoro-82M.
Model tree for relingo/kokoro-vi-web
Base model
contextboxai/Kokoro-Vietnamese