NeuML / txtai-speecht5-onnx

huggingface.co
Total runs: 0
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Model's Last Updated: October 10 2024
text-to-speech

Introduction of txtai-speecht5-onnx

Model Details of txtai-speecht5-onnx

SpeechT5 Text-to-Speech (TTS) Model for ONNX

Fine-tuned version of SpeechT5 TTS exported to ONNX. This model was exported to ONNX using the Optimum library.

Usage with txtai

txtai has a built in Text to Speech (TTS) pipeline that makes using this model easy.

Note the following example requires txtai >= 7.5

import soundfile as sf

from txtai.pipeline import TextToSpeech

# Build pipeline
tts = TextToSpeech("NeuML/txtai-speecht5-onnx")

# Generate speech
speech, rate = tts("Say something here")

# Write to file
sf.write("out.wav", speech, rate)

# Generate speech with custom speaker
speech, rate = tts("Say something here", speaker=np.array(...))
Model training

This model was fine-tuned using the code in this Hugging Face article and a custom set of WAV files.

The ONNX export uses the following code, which requires installing optimum .

import os

from optimum.exporters.onnx import main_export
from optimum.onnx import merge_decoders

# Params
model = "txtai-speecht5-tts"
output = "txtai-speecht5-onnx"

# ONNX Export
main_export(
    task="text-to-audio",
    model_name_or_path=model,
    model_kwargs={
        "vocoder": "microsoft/speecht5_hifigan"
    },
    output = output
)

# Merge into single decoder model
merge_decoders(
    f"{output}/decoder_model.onnx",
    f"{output}/decoder_with_past_model.onnx",
    save_path=f"{output}/decoder_model_merged.onnx",
    strict=False
)

# Remove unnecessary files
os.remove(f"{output}/decoder_model.onnx")
os.remove(f"{output}/decoder_with_past_model.onnx")
Custom speaker embeddings

When no speaker argument is passed in, the default speaker embeddings are used. The defaults speaker is David Mezzetti, the primary developer of txtai.

It's possible to build custom speaker embeddings as shown below. Fine-tuning the model with a new voice leads to the best results but zero-shot speaker embeddings are OK in some cases.

The following code requires installing torchaudio and speechbrain .

import os

import numpy as np
import torchaudio

from speechbrain.inference import EncoderClassifier

def speaker(path):
    """
    Extracts a speaker embedding from an audio file.

    Args:
        path: file path

    Returns:
        speaker embeddings
    """

    model = "speechbrain/spkrec-xvect-voxceleb"
    encoder = EncoderClassifier.from_hparams(model,
                                             savedir=os.path.join("/tmp", model),
                                             run_opts={"device": "cuda"})

    samples, sr = torchaudio.load(path)
    samples = encoder.audio_normalizer(samples[0], sr)
    embedding = encoder.encode_batch(samples.unsqueeze(0))

    return embedding[0,0].to("cuda").unsqueeze(0)

embedding = speaker("reference.wav")
np.save("speaker.npy", embedding.cpu().numpy(), allow_pickle=False)

Then load as shown below.

speech, rate = tts("Say something here", speaker=np.load("speaker.npy"))

Speaker embeddings from the original SpeechT5 TTS training set are supported. See the README for more.

Runs of NeuML txtai-speecht5-onnx on huggingface.co

0
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About txtai-speecht5-onnx huggingface.co Model

More txtai-speecht5-onnx license Visit here:

https://choosealicense.com/licenses/apache-2.0

txtai-speecht5-onnx huggingface.co

txtai-speecht5-onnx huggingface.co is an AI model on huggingface.co that provides txtai-speecht5-onnx's model effect (), which can be used instantly with this NeuML txtai-speecht5-onnx model. huggingface.co supports a free trial of the txtai-speecht5-onnx model, and also provides paid use of the txtai-speecht5-onnx. Support call txtai-speecht5-onnx model through api, including Node.js, Python, http.

txtai-speecht5-onnx huggingface.co Url

https://huggingface.co/NeuML/txtai-speecht5-onnx

NeuML txtai-speecht5-onnx online free

txtai-speecht5-onnx huggingface.co is an online trial and call api platform, which integrates txtai-speecht5-onnx's modeling effects, including api services, and provides a free online trial of txtai-speecht5-onnx, you can try txtai-speecht5-onnx online for free by clicking the link below.

NeuML txtai-speecht5-onnx online free url in huggingface.co:

https://huggingface.co/NeuML/txtai-speecht5-onnx

txtai-speecht5-onnx install

txtai-speecht5-onnx is an open source model from GitHub that offers a free installation service, and any user can find txtai-speecht5-onnx on GitHub to install. At the same time, huggingface.co provides the effect of txtai-speecht5-onnx install, users can directly use txtai-speecht5-onnx installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

txtai-speecht5-onnx install url in huggingface.co:

https://huggingface.co/NeuML/txtai-speecht5-onnx

Url of txtai-speecht5-onnx

txtai-speecht5-onnx huggingface.co Url

Provider of txtai-speecht5-onnx huggingface.co

NeuML
ORGANIZATIONS

Other API from NeuML

huggingface.co

Total runs: 1.9K
Run Growth: 1.4K
Growth Rate: 73.33%
Updated:January 27 2025
huggingface.co

Total runs: 1.2K
Run Growth: 334
Growth Rate: 27.79%
Updated:February 21 2023
huggingface.co

Total runs: 1.1K
Run Growth: -170
Growth Rate: -16.18%
Updated:January 27 2025
huggingface.co

Total runs: 853
Run Growth: 250
Growth Rate: 29.31%
Updated:February 21 2023
huggingface.co

Total runs: 521
Run Growth: -99.9K
Growth Rate: -19182.34%
Updated:January 27 2025
huggingface.co

Total runs: 285
Run Growth: 98
Growth Rate: 34.39%
Updated:January 27 2025
huggingface.co

Total runs: 194
Run Growth: 97
Growth Rate: 50.00%
Updated:April 21 2026
huggingface.co

Total runs: 31
Run Growth: 14
Growth Rate: 45.16%
Updated:October 10 2025
huggingface.co

Total runs: 12
Run Growth: -9
Growth Rate: -75.00%
Updated:November 23 2024
huggingface.co

Total runs: 7
Run Growth: -2
Growth Rate: -28.57%
Updated:July 21 2026
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:November 11 2025