ema-lightning-mlx / README.md
faraday's picture
Add EMA Lightning weights for native Swift/MLX inference
f1d2d03
|
Raw History Blame Contribute Delete
2.92 kB
---
license: apache-2.0
language:
- tr
pipeline_tag: text-to-speech
base_model: canberkkkkkk/ema-lightning
library_name: mlx
tags:
- turkish
- text-to-speech
- mlx-swift
- safetensors
- apple-silicon
---
# EMA Lightning — MLX Swift voice weights
MLX-compatible weights converted from [EMA Lightning](https://huggingface.co/canberkkkkkk/ema-lightning), by Canberk Aslan. This is an **EMA native Swift/MLX voice bundle**, with the vocabulary, tensor schema, decoder architecture, sampling schedule and provenance in `voice-manifest.json`. It is not an `mlx-lm`, Transformers, or generic MLX Audio drop-in checkpoint.
## Files
| File | Purpose |
|---|---|
| `acoustic.safetensors` | FP32 text/duration, conditioning and acoustic model weights, using MLX layouts. |
| `decoder.safetensors` | Canonical FP32 decoder weights, using MLX convolution layouts. |
| `constants.safetensors` | FP32 source-generated rotary and timestep constants. |
| `voice-manifest.json` | Runtime format-v2 schema, shapes, vocabulary, architecture and asset SHA256 values. |
| `adapter-validation.json` | Original export adapter validation evidence. |
| `conversion-manifest.json` | Exporter/source provenance, asset checks and stored precision. |
| `CHECKSUMS.sha256` | SHA256 checksums for the distributed files. |
| `LICENSE` / `NOTICE` | Upstream Apache 2.0 license and attribution. |
## Precision
All tensors in the three safetensors files are stored in **FP32**. No training, distillation or quantization was performed for this export. Inference precision and kernel selection are controlled by the consuming application, independently of these stored weights.
## Usage
Use the compatible EMA native Swift/MLX application with this folder as its model directory. For FP32 inference:
```sh
ema synthesize "Merhaba dünya." --engine mlx --variant fp32 --model-dir /path/to/ema-lightning-mlx --seed 7 --output speech.wav
```
The bundle contains weights and model metadata. The matching application supplies the executable, text normalizer and Metal shader library. Asset layouts and schema target mlx-swift 0.32.3.
## Export validation
`adapter-validation.json` records the original export adapter checks. `voice-manifest.json` records tensor shapes and asset hashes; `CHECKSUMS.sha256` covers the distributed files. These reports describe the weight export. Inference accuracy and performance depend on the consuming runtime and its configuration.
## Conversion
The existing export was made by `Engines/mlx/conversion/export_mlx.py` in the EMA native project. PyTorch Conv1d OIK and ConvTranspose1d IOK layouts are converted to MLX OKI; scalar tensor shapes are retained. The voice manifest records the source revision/checkpoints and all transformations. A fresh export can be made from the pinned local original source and checkpoints with that script; copying this existing verified bundle does not reconvert or retrain it.