EMA Lightning (ONNX + WebAssembly normaliser)
EMA Lightning, a Turkish text-to-speech model with 8.6M parameters and 48 kHz output, exported to ONNX so it can run on ONNX Runtime, including in the browser with ONNX Runtime Web. The repository also carries normalizer-tr compiled to WebAssembly, the text normaliser that reads numbers, dates, money, units and abbreviations aloud.
These are the files delicious-cipetpet packs into
ema-lightning-fp32.cpet. The weights are the original model's, unchanged. Nothing was retrained or quantised.
Files
| File | What it is | SHA-256 |
|---|---|---|
text.onnx |
letters → text features h and durations dur |
bf6bc2bb7bcd7f61c2d1e58fced4e58b92ea6806e07befcabf0824d7d33a8ab8 |
sound.onnx |
features + frame timeline + noise → latents (4 flow steps inside the graph) | 3924d67f00c65d6b4c0632cd3c152fef9987df4e29f738533d357036ce3f6420 |
decoder.onnx |
latents → 48 kHz audio (1920 samples per frame) | 8246d10b495a5ead733f5478b7c732dc39f4662e08b314cb84a4758bbc1db13d |
config.json |
vocabulary and constants (latent_dim, steps, hop, sample_rate, fps) |
293a43a887b7cbdecd458e3961bffb440bb385957eaec7c14a35378fa6f1de8b |
normalizer_tr_wasm_bg.wasm |
normalizer-tr 0.8.0 (fallback policy) via wasm-bindgen 0.2.129 |
946ba22f3f610357d192f84963d9b446a3828c25b847f29c03bca0cf64f9a341 |
ema-lightning.json |
where every file comes from, in machine-readable form |
SHA256SUMS lists the same hashes.
Graph signatures (fp32, opset 17, dynamic letters and frames axes):
text.onnx ids int64 [1,L] -> h f32 [1,L,C], dur f32 [1,L]
sound.onnx h, dur, cw int64 [1,L], wstart int64 [1,L],
fw int64 [1,T], fp f32 [1,T], noise f32 [1,4,T,64] -> latents f32 [1,T,64]
decoder.onnx z f32 [1,N,64] -> audio f32 [1,N*1920]
Where the files come from
- Weights:
ema.ptanddecoder.ptof canberkkkkkk/ema-lightning at commit7a6ba1ad216bb2f1da9863f80ac8770a6a807632. - ONNX: exported with
web/export_onnx.pyfrom the ema-lightning browser port. The script checks every stage against PyTorch, and the export agrees with it to at least 87 dB (audio: 119 dB). The export is reproducible: running it again with Python 3.12, torch 2.14.1 and onnx 1.23.2 gives these exact bytes. - Normaliser: normalizer-tr 0.8.0 with the
fallbackpolicy, compiled forwasm32-unknown-unknownwith Rust 1.94.0 and wasm-bindgen 0.2.129. ema-lightning 1.1.2 accepts normalizer-tr 0.6 to 0.x, so text is read the way that release reads it. For example,iPhone'umdanbecomes "ayfonumdan" andSON DAKİKAis read as words.
The model code that 1.1.2 changed since the export (loading checkpoints with weights_only=True, how the CPU
scheduler batches windows) does not affect the graphs.
Using them
With delicious-cipetpet in the browser or in Node:
import { EmaLightning } from "cipetpet";
const tts = await EmaLightning.load("/packs/ema-lightning-fp32.cpet", { wasmPaths: "/ort/" });
const { audio, sampleRate } = await tts.synthesize("Merhaba, size nasıl yardımcı olabilirim?");
To run the graphs yourself, follow ema-lightning's engine.py. The text is normalised, then cut into pieces of at
most about 10 seconds. Each piece goes through text.onnx. The durations become a frame timeline: frame counts per
word, rounded half to even, and each frame's position inside its word. sound.onnx turns that timeline into
latents, and decoder.onnx decodes them in windows with 8 frames of context on each side.
Limitations
These are the original model's: one voice, Turkish only, naturalness around UTMOS 3.3. The browser port seeds its noise with its own generator (mulberry32 + Box-Muller), not torch's, so a seed gives different audio here than in the Python package.
Credits and licence
- EMA Lightning by Canberk Aslan, Apache-2.0: model, code.
- normalizer-tr by Erdem Tuna, Apache-2.0: github.com/erdemtuna/normalizer-tr.
This export is distributed under the same licence, Apache-2.0 (see LICENSE).
- Downloads last month
- 56
Model tree for tedash34/ema-lightning-onnx
Base model
canberkkkkkk/ema-lightning