Spaces:
Running
Running
|
Download README.md from Quantumbraid/soprano-web-onnx: direct link, hf CLI and curl.
- Browser
- Download file 3.31 kB
-
https://huggingface.co/spaces/Quantumbraid/soprano-web-onnx/resolve/main/README.md
- Command line
-
hf download hf://spaces/Quantumbraid/soprano-web-onnx/README.md
-
curl -L -o README.md https://huggingface.co/spaces/Quantumbraid/soprano-web-onnx/resolve/main/README.md
3.31 kB
metadata
title: Soprano 1.1 ONNX Web Demo
emoji: 🎧
colorFrom: blue
colorTo: indigo
sdk: static
short_description: Real-time text-to-speech in the browser using ONNX
app_file: index.html
pinned: false
models:
- KevinAHM/soprano-1.1-onnx
license: apache-2.0
custom_headers:
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: cross-origin
Soprano 1.1 ONNX Streaming — Instant Text‑to‑Speech in the Browser (WASM)
A static, client-side browser demo that runs the Soprano TTS pipeline using onnxruntime-web.
Soprano 1.1 features significant performance optimizations, including moving all heavy inference to a Web Worker and utilizing an int8 quantized decoder for superior real-time speeds on consumer CPUs.
Requirements
- 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.
Folder layout
Place model artifacts under ./models/:
.
├─ index.html
├─ onnx-streaming.js (Main Thread Client)
├─ inference-worker.js (Heavy Inference Engine)
├─ PCMPlayerWorklet.js (Audio Playback Worklet)
├─ style.css
├─ onnx/
│ ├─ soprano_backbone_kv_fp32.onnx
│ └─ soprano_decoder_int8.onnx
...
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.
Run locally
Use any static file server from this directory, for example:
python -m http.server 8085
Then open http://localhost:8085.
Configuration
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
Troubleshooting
- "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
- Web Worker: Keeps the UI responsive (no lag during generation).
- int8 Decoder: Optimized for high-throughput CPU inference.
- Achieves real-time streaming on modern hardware
License & attribution
Soprano is released under Apache-2.0 in the upstream repository: https://github.com/ekwek1/soprano