ONNX Model Zoo

ylacombe/mms-spa-finetuned-chilean-monospeaker

By ylacombe · ↓ 9 · ♥ 2 · Updated 2024-01-02

What's in this repo

This page lists the files in ylacombe/mms-spa-finetuned-chilean-monospeaker, including model.onnx, model_quantized.onnx.

  • 2 ONNX models (.onnx files)
  • 12 files, including 7 .json, 2 .onnx, 1 .md, 1 .safetensors
  • Last updated 2024-01-02

ONNX files

File Size Download
onnx/model.onnx — Download
onnx/model_quantized.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Model

This is a finetuned version of the Spanish version of Massively Multilingual Speech (MMS) models, which are light-weight, low-latency TTS models based on the VITS architecture.

It was trained in around 20 minutes with as little as 80 to 150 samples, on this Chilean Spanish dataset.

Training recipe available in this github repository: ylacombe/finetune-hf-vits.

Usage

Transformers

from transformers import pipeline
import scipy

model_id = "ylacombe/mms-spa-finetuned-chilean-monospeaker"
synthesiser = pipeline("text-to-speech", model_id) # add device=0 if you want to use a GPU

speech = synthesiser("Hola, ¿cómo estás hoy?")

scipy.io.wavfile.write("finetuned_output.wav", rate=speech["sampling_rate"], data=speech["audio"])

Transformers.js

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @xenova/transformers

Example: Generate Spanish speech with ylacombe/mms-spa-finetuned-chilean-monospeaker.

import { pipeline } from '@xenova/transformers';

// Create a text-to-speech pipeline
const synthesizer = await pipeline('text-to-speech', 'ylacombe/mms-spa-finetuned-chilean-monospeaker', {
    quantized: false, // Remove this line to use the quantized version (default)
});

// Generate speech
const output = await synthesizer('Hola, ¿cómo estás hoy?');
console.log(output);
// {
//   audio: Float32Array(69888) [ ... ],
//   sampling_rate: 16000
// }

Optionally, save the audio to a wav file (Node.js):

import wavefile from 'wavefile';
import fs from 'fs';

const wav = new wavefile.WaveFile();
wav.fromScratch(1, output.sampling_rate, '32f', output.audio);
fs.writeFileSync('out.wav', wav.toBuffer());

Model info

text-to-speech transformers
transformers onnx safetensors vits transformers.js mms text-to-speech es dataset:ylacombe/google-chilean-spanish license:cc-by-nc-4.0 endpoints_compatible region:us
↓ 9 ♥ 2

Created: 2023-11-28

Updated: 2024-01-02

View on Hugging Face

Files (12)

.gitattributes
README.md
added_tokens.json
config.json
model.safetensors
onnx/model.onnx ONNX
onnx/model_quantized.onnx ONNX
preprocessor_config.json
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.json

Related models