diff --git a/kokoro.js/README.md b/kokoro.js/README.md index 61a76ab..9190fd5 100644 --- a/kokoro.js/README.md +++ b/kokoro.js/README.md @@ -5,10 +5,10 @@ NPM Downloads jsDelivr Hits License - Demo + Demo

-Kokoro is a frontier TTS model for its size of 82 million parameters (text in/audio out). This JavaScript library allows the model to be run 100% locally in the browser thanks to [πŸ€— Transformers.js](https://huggingface.co/docs/transformers.js). Try it out using our [online demo](https://huggingface.co/spaces/webml-community/kokoro-web)! +Kokoro is a frontier TTS model for its size of 82 million parameters (text in/audio out). This JavaScript library allows the model to be run 100% locally in the browser thanks to [πŸ€— Transformers.js](https://huggingface.co/docs/transformers.js). Try it out using our [online demo](https://huggingface.co/spaces/webml-community/kokoro-webgpu)! ## Usage @@ -23,33 +23,59 @@ You can then generate speech as follows: ```js import { KokoroTTS } from "kokoro-js"; -const model_id = "onnx-community/Kokoro-82M-ONNX"; +const model_id = "onnx-community/Kokoro-82M-v1.0-ONNX"; const tts = await KokoroTTS.from_pretrained(model_id, { dtype: "q8", // Options: "fp32", "fp16", "q8", "q4", "q4f16" + device: "wasm", // Options: "wasm", "webgpu" (web) or "cpu" (node). If using "webgpu", we recommend using dtype="fp32". }); const text = "Life is like a box of chocolates. You never know what you're gonna get."; const audio = await tts.generate(text, { // Use `tts.list_voices()` to list all available voices - voice: "af_bella", + voice: "af_heart", }); audio.save("audio.wav"); ``` ## Voices/Samples -> Life is like a box of chocolates. You never know what you're gonna get. +> [!TIP] +> You can find samples for each of the voices in the [model card](https://huggingface.co/onnx-community/Kokoro-82M-v1.0-ONNX#samples) on Hugging Face. -| Voice | Nationality | Gender | Sample | -| ------------------------ | ----------- | ------ | -------------------------------------------------------------------------------------------------------- | -| Default (`af`) | American | Female |