Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,107 +1,111 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Soprano 1.1 ONNX Web Demo
|
| 3 |
-
emoji: π§
|
| 4 |
-
colorFrom: blue
|
| 5 |
-
colorTo: indigo
|
| 6 |
-
sdk: static
|
| 7 |
-
short_description: Real-time text-to-speech in the browser using ONNX
|
| 8 |
-
app_file: index.html
|
| 9 |
-
pinned: false
|
| 10 |
-
models:
|
| 11 |
-
- KevinAHM/soprano-1.1-onnx
|
| 12 |
-
license: apache-2.0
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
--
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
ββ
|
| 50 |
-
ββ onnx
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
.
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
- `
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
- **
|
| 94 |
-
-
|
| 95 |
-
-
|
| 96 |
-
-
|
| 97 |
-
|
| 98 |
-
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Soprano 1.1 ONNX Web Demo
|
| 3 |
+
emoji: π§
|
| 4 |
+
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: static
|
| 7 |
+
short_description: Real-time text-to-speech in the browser using ONNX
|
| 8 |
+
app_file: index.html
|
| 9 |
+
pinned: false
|
| 10 |
+
models:
|
| 11 |
+
- KevinAHM/soprano-1.1-onnx
|
| 12 |
+
license: apache-2.0
|
| 13 |
+
custom_headers:
|
| 14 |
+
cross-origin-embedder-policy: require-corp
|
| 15 |
+
cross-origin-opener-policy: same-origin
|
| 16 |
+
cross-origin-resource-policy: cross-origin
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
<!-- Version 0.0.3 -->
|
| 20 |
+
<div align="center">
|
| 21 |
+
|
| 22 |
+
# Soprano 1.1 ONNX Streaming β Instant TextβtoβSpeech in the Browser (WASM)
|
| 23 |
+
|
| 24 |
+
[](https://github.com/ekwek1/soprano)
|
| 25 |
+
[](https://huggingface.co/KevinAHM/soprano-onnx)
|
| 26 |
+
[](https://huggingface.co/spaces/KevinAHM/soprano-web-onnx)
|
| 27 |
+
|
| 28 |
+
A **static, client-side** browser demo that runs the Soprano TTS pipeline using **onnxruntime-web**.
|
| 29 |
+
|
| 30 |
+
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.
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## Requirements
|
| 35 |
+
|
| 36 |
+
- A modern browser (Chrome, Edge, Firefox, Safari).
|
| 37 |
+
- You must serve this folder over HTTP (opening `index.html` via `file://` usually breaks `fetch()` / module loading).
|
| 38 |
+
- The demo loads `onnxruntime-web` and `@huggingface/transformers` from a CDN by default (network required unless you vendor them).
|
| 39 |
+
- The model files are large; plan to use **Git LFS** or GitHub Releases if you publish them.
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
## Folder layout
|
| 44 |
+
|
| 45 |
+
Place model artifacts under `./models/`:
|
| 46 |
+
|
| 47 |
+
```text
|
| 48 |
+
.
|
| 49 |
+
ββ index.html
|
| 50 |
+
ββ onnx-streaming.js (Main Thread Client)
|
| 51 |
+
ββ inference-worker.js (Heavy Inference Engine)
|
| 52 |
+
ββ PCMPlayerWorklet.js (Audio Playback Worklet)
|
| 53 |
+
ββ style.css
|
| 54 |
+
ββ onnx/
|
| 55 |
+
β ββ soprano_backbone_kv_fp32.onnx
|
| 56 |
+
β ββ soprano_decoder_int8.onnx
|
| 57 |
+
...
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Notes:
|
| 61 |
+
- ONNX models live in `onnx/` following HuggingFace convention.
|
| 62 |
+
- The decoder uses external weights (`.onnx.data` file must be present alongside the `.onnx` file).
|
| 63 |
+
- Tokenizer files are in the root directory.
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
## Run locally
|
| 68 |
+
|
| 69 |
+
Use any static file server from this directory, for example:
|
| 70 |
+
|
| 71 |
+
```bash
|
| 72 |
+
python -m http.server 8085
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
Then open `http://localhost:8085`.
|
| 76 |
+
|
| 77 |
+
---
|
| 78 |
+
|
| 79 |
+
## Configuration
|
| 80 |
+
|
| 81 |
+
Model paths are defined near the top of `onnx-streaming.js` in the `MODELS` object.
|
| 82 |
+
|
| 83 |
+
Sampling defaults are set in `onnx-streaming.js` (constructor):
|
| 84 |
+
- `temperature`
|
| 85 |
+
- `topK`
|
| 86 |
+
- `topP`
|
| 87 |
+
- `repetitionPenalty`
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## Troubleshooting
|
| 92 |
+
|
| 93 |
+
- **"Load failed" / model never becomes Ready**
|
| 94 |
+
- Verify the `onnx/` filenames match `MODELS` in `onnx-streaming.js`
|
| 95 |
+
- Check DevTools β Network for a missing `.onnx.data` file (404)
|
| 96 |
+
- Confirm `/` contains `tokenizer.json` (and related files)
|
| 97 |
+
- **Performance notes**
|
| 98 |
+
- **Web Worker:** Keeps the UI responsive (no lag during generation).
|
| 99 |
+
- **int8 Decoder:** Optimized for high-throughput CPU inference.
|
| 100 |
+
- Achieves real-time streaming on modern hardware
|
| 101 |
+
|
| 102 |
+
---
|
| 103 |
+
|
| 104 |
+
## License & attribution
|
| 105 |
+
|
| 106 |
+
Soprano is released under **Apache-2.0** in the upstream repository:
|
| 107 |
+
https://github.com/ekwek1/soprano
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
|
| 111 |
+
|