Instructions to use Kanha-AI/supertonic-tts-2-fp16-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Kanha-AI/supertonic-tts-2-fp16-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-to-speech', 'Kanha-AI/supertonic-tts-2-fp16-ONNX');
Supertonic 2 ONNX with fp16 weights
This repository adds half precision (fp16) ONNX weights to onnx-community/Supertonic-TTS-2-ONNX, the Transformers.js export of Supertone/supertonic-2. It is used by the Kanha chat widget to read answers aloud in the browser.
Changes from the base model
onnx/*_fp16.onnxandonnx/*_fp16.onnx_datawere converted from the fp32 weights withonnxconverter_common.float16(inputs and outputs kept fp32). The duplicated opset import was merged and eachCastnode's target type was aligned with its declared output type so the sessions load in ONNX Runtime Web.- The fp32 files, tokenizer, config and voice styles are unchanged copies of the base repository.
The fp16 weights are about 126 MB instead of 262 MB and run on WebGPU. Use the fp32 weights on the CPU (WASM).
Usage
import { pipeline } from "@huggingface/transformers";
const tts = await pipeline("text-to-speech", "Kanha-AI/supertonic-tts-2-fp16-ONNX", {
device: "webgpu",
dtype: "fp16",
});
const audio = await tts("<en>This is really cool!</en>", {
speaker_embeddings: "https://huggingface.co/Kanha-AI/supertonic-tts-2-fp16-ONNX/resolve/main/voices/F1.bin",
num_inference_steps: 5,
speed: 1.05,
});
Voices: F1 to F5 and M1 to M5. Languages: en, ko, es, pt, fr.
License
The model is licensed under the BigScience Open RAIL-M License (see LICENSE), including its use-based restrictions, which apply to this derivative and to any further redistribution. The original model is by Supertone.
- Downloads last month
- 24
Model tree for Kanha-AI/supertonic-tts-2-fp16-ONNX
Base model
Supertone/supertonic-2