Text-to-Speech
Transformers.js
ONNX
Malay
style_text_to_speech_2
tts
webgpu
malay
bahasa-melayu
tiny
Run this model with HF Jobs
Run lseanlon/suaradee-v0.2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/lseanlon/suaradee-v0.2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/lseanlon/suaradee-v0.2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use lseanlon/suaradee-v0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use lseanlon/suaradee-v0.2 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-to-speech', 'lseanlon/suaradee-v0.2');
File size: 1,348 Bytes
55bb263 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | // npm i @huggingface/transformers (Node 18+); run from the repo root: node examples/node_example.mjs
import { writeFileSync } from 'node:fs';
import { Suaradee, SAMPLE_RATE } from '../js/suaradee.js';
import { G2P } from '../js/g2p/ms_g2p.js';
import { readFileSync } from 'node:fs';
const load = (f) => JSON.parse(readFileSync(new URL('../js/g2p/' + f, import.meta.url), 'utf8'));
const g2p = new G2P({ vocab: load('vocab.json'), lexE: load('lexicon_e.json'), lexX: load('lexicon_exceptions.json'), lexEn: load('lexicon_en.json') },
{ stress: false, r: 'r', diph: 'glide' });
const tts = await Suaradee.load({ model: 'lseanlon/suaradee-v0.2', g2p });
const { audio } = await tts.speak('Selamat pagi, boleh saya bantu encik hari ini?');
const pcm = Buffer.alloc(44 + audio.length * 2);
pcm.write('RIFF', 0); pcm.writeUInt32LE(36 + audio.length * 2, 4); pcm.write('WAVEfmt ', 8); pcm.writeUInt32LE(16, 16); pcm.writeUInt16LE(1, 20);
pcm.writeUInt16LE(1, 22); pcm.writeUInt32LE(SAMPLE_RATE, 24); pcm.writeUInt32LE(SAMPLE_RATE * 2, 28); pcm.writeUInt16LE(2, 32); pcm.writeUInt16LE(16, 34);
pcm.write('data', 36); pcm.writeUInt32LE(audio.length * 2, 40);
audio.forEach((x, i) => pcm.writeInt16LE(Math.round(Math.max(-1, Math.min(1, x)) * 32767), 44 + i * 2));
writeFileSync('hello.wav', pcm);
console.log('hello.wav written');
|