YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Supertonic-3 LiteRT fixed multi-preset exporter

This exporter rebuilds the four public Supertonic-3 ONNX graphs as fixed-shape LiteRT models with these presets:

  • T = 32 / 48 / 64 / 80 / 96 / 112 / 128
  • L = 32 / 48 / 64 / 80 / 96 / 112 / 128

The output uses LiteRT multiple signatures, not 49 duplicated model files. The large immutable weight buffers are shared inside each FlatBuffer.

Output signatures

File Signatures
duration_predictor.tflite T32 ... T128 (7)
text_encoder.tflite T32 ... T128 (7)
vector_estimator.tflite T32_L32 ... T128_L128 (49)
vocoder.tflite L32 ... L128 (7)

Export

Use Python 3.12 on Linux. Install the pinned CPU toolchain:

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

The source directory must contain the official dynamic ONNX files duration_predictor.onnx, text_encoder.onnx, vector_estimator.onnx, and vocoder.onnx.

.venv/bin/python export_mult_preset.py \
  --onnx-dir /path/to/Supertonic-3/onnx \
  --asset-dir /path/to/Supertonic-3 \
  --output-dir ./Supertonic-3-LiteRT-MultiPreset

Validate every signature against ONNX Runtime:

.venv/bin/python validate_mult_preset.py \
  --onnx-dir /path/to/Supertonic-3/onnx \
  --model-dir ./Supertonic-3-LiteRT-MultiPreset

Runtime selection

T is the padded text-token capacity. L is the padded latent-frame capacity. Choose the smallest preset that fits each request:

T = first preset >= token_count
predicted_L = ceil((duration_seconds / speed) * 44100 / 3072)
L = first preset >= predicted_L

Use the same T signature for the duration predictor and text encoder. Then use T{T}_L{L} for the vector estimator and L{L} for the vocoder. Pad masks and inputs to the selected capacities, and trim the final waveform back to the predicted sample count. If either value exceeds 128, split the text into another chunk; do not silently truncate it.

The fixed buckets are capacities, not quality levels. Smaller fitting buckets avoid unnecessary text-attention and latent/vocoder work while preserving the same FP32 weights.

Why ONNX Runtime BASIC specialization is used

The source ONNX graphs are dynamic. Before ONNX-to-PyTorch reconstruction, each signature is specialized with ONNX Runtime's semantics-preserving BASIC graph optimizer. This folds shape arithmetic while avoiding the incorrect attention rewrite observed with onnxsim --overwrite-input-shape on this model. Every final signature is checked directly against the original dynamic ONNX graph.

Licensing

The exporter code is provided for working with the public model. Supertonic-3 weights and derived LiteRT files remain subject to the model's OpenRAIL-M license. Preserve the upstream LICENSE and attribution when distributing the generated bundle.

Downloads last month
29
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support