A static, client-side browser demo that runs the Soprano TTS pipeline using onnxruntime-web.
This is a conversion/port of the original Soprano project: https://github.com/ekwek1/soprano
- A modern browser (Chrome, Edge, Firefox, Safari).
- You must serve this folder over HTTP (opening
index.htmlviafile://usually breaksfetch()/ module loading). - The demo loads
onnxruntime-weband@huggingface/transformersfrom a CDN by default (network required unless you vendor them). - The model files are large; plan to use Git LFS or GitHub Releases if you publish them.
Place model artifacts under ./models/:
.
├─ index.html
├─ onnx-streaming.js
├─ PCMPlayerWorklet.js
├─ style.css
├─ onnx/
│ ├─ soprano_backbone_kv.onnx
│ ├─ soprano_decoder.onnx
│ └─ soprano_decoder.onnx.data
├─ tokenizer.json
├─ tokenizer_config.json
├─ special_tokens_map.json
├─ config.json
└─ generation_config.json
Notes:
- ONNX models live in
onnx/following HuggingFace convention. - The decoder uses external weights (
.onnx.datafile must be present alongside the.onnxfile). - Tokenizer files are in the root directory.
Use any static file server from this directory, for example:
python -m http.server 8085Then open http://localhost:8085.
Model paths are defined near the top of onnx-streaming.js in the MODELS object.
Sampling defaults are set in onnx-streaming.js (constructor):
temperaturetopKtopPrepetitionPenalty
- "Load failed" / model never becomes Ready
- Verify the
onnx/filenames matchMODELSinonnx-streaming.js - Check DevTools → Network for a missing
.onnx.datafile (404) - Confirm
/containstokenizer.json(and related files)
- Verify the
- Performance notes
- Both backbone and decoder run on WASM/CPU
- Achieves real-time streaming on modern hardware
Soprano is released under Apache-2.0 in the upstream repository: https://github.com/ekwek1/soprano