Upload Chatterbox-ONNX-WebGPU
Browse filesFiles changed (4)
- LICENSEAdded+21
- README.mdAdded+45
- onnx/conditional_decoder.onnxAdded+3
- voices/default.binAdded+3
123456789101112131415161718192021MIT License
Copyright (c) 2025 Resemble AI
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445---license: mitbase_model:- ResembleAI/chatterboxtags:- onnx- webgpu- text-to-speech- quick-inference---
# Chatterbox-ONNX-WebGPU
[ResembleAI/chatterbox](https://huggingface.co/ResembleAI/chatterbox) (English) for running in a web browser with ONNXRuntime Web's WebGPU backend, as used by Quick Inference: a smaller speech decoder and a precomputed default voice.The language model and token embeddings are onnx-community's, used unchanged from[onnx-community/chatterbox-ONNX](https://huggingface.co/onnx-community/chatterbox-ONNX) (revision `3cab09af`):`language_model_q4`, `embed_tokens` and `tokenizer.json`.
## Changes from the original
- `onnx/conditional_decoder.onnx`: onnx-community's float32 `conditional_decoder.onnx` quantized without calibration (round to nearest, symmetric, blocks of 32): matrix multiplications to 4-bit `MatMulNBits`, convolution weights to blocked int8 `DequantizeLinear` (opset 21; 4 bits made the vocoder brighter). Activations stay float32. 534 MB → 145 MB.- `voices/default.bin` (0.26 MB): what onnx-community's `speech_encoder.onnx` (float32) outputs for its `default_voice.wav`, computed once, so the browser needs neither the speech encoder (591 MB) nor a reference clip. Little-endian float32: N, P, F, then `audio_features` [N, 1024], `audio_tokens` [P] (whole numbers), `speaker_embeddings` [192] and `speaker_features` [F, 80]. Made by `tools/export/chatterbox_voice.py` in [Quick Inference](https://github.com/mdanyalmalik/quick-inf).
The decoder is a modified file: its output is close to, but not identical to, the original's. On eight testsentences, Whisper small.en heard it with a 4.5% word error rate, the same as the original float32 graphs.
## Use
As the ONNX example in onnx-community's model card, with this file's four arrays in place of the speech encoder'soutputs (`audio_features` before the text's embeddings in the first language-model step, exaggeration 0.5, greedyspeech tokens with repetition penalty 1.2 until token 6562) and this decoder: `audio_tokens` and the new tokens withthe two speaker arrays → 24 kHz audio. Quick Inference speaks one sentence at a time and runs the text through thePython package's `punc_norm` first.
## Licence
MIT, as Chatterbox (`LICENSE`).123version https://git-lfs.github.com/spec/v1oid sha256:4bc107a9996b313f5d1a094cdbccd9afaa20e6be596170eac74d8b0d903f1663size 145358459123version https://git-lfs.github.com/spec/v1oid sha256:1cb6ec75b9d8e58c4c5d7936c887307fe16c7b76bd91bbeda9e503fc9a9f8191size 255732LICENSEAdded+21
README.mdAdded+45
onnx/conditional_decoder.onnxAdded+3
voices/default.binAdded+3