Skip to main content

Hebrew Text-to-Speech inference using ONNX and TensorRT

Project description

Blue

Text-to-speech inference with ONNX Runtime; optional TensorRT acceleration on NVIDIA GPUs.

PyPI version   Try Live Demo on Hugging Face   lightbluetts.com

Hebrew, English, Spanish, Italian, and German — samples and a live demo on the site and Space above.

Install

Users (PyPI)

pip install blue-onnx

Optional accelerators (PyPI): install the extra, then drop the stock CPU wheel so a single build owns onnxruntime:

  • Intel OpenVINO: pip install "blue-onnx[openvino]" then pip uninstall onnxruntime
  • NVIDIA CUDA: pip install "blue-onnx[gpu]" then pip uninstall onnxruntime

This repository

git clone https://github.com/maxmelichov/BlueTTS.git
cd BlueTTS
uv sync

Optional extras:

uv sync --extra openvino   # Intel OpenVINO EP (then: uv pip uninstall onnxruntime)
uv sync --extra gpu        # NVIDIA CUDA ORT (then: uv pip uninstall onnxruntime)
uv sync --extra tensorrt   # TensorRT path (see below)
uv sync --extra export     # PyTorch / export tooling

The default environment uses the stock onnxruntime CPU wheel. OpenVINO and CUDA (gpu) are optional; each adds a second ONNX Runtime distribution until you remove the stock CPU wheel so the accelerator build owns the onnxruntime import (uv pip uninstall onnxruntime, or the same with pip after a PyPI install with [openvino] or [gpu]). Do not combine the openvino and gpu extras.

Models

ONNX bundle (default voices, excludes the large all_voices set):

uv run hf download notmax123/blue-onnx --repo-type model --local-dir ./onnx_models \
  --exclude "voices/all_voices/**"

Optional

  • Hebrew G2P:
    wget -O model.onnx https://huggingface.co/thewh1teagle/renikud/resolve/main/model.onnx
    
  • 2000+ voice JSONs:
    uv run hf download notmax123/blue-onnx voices/all_voices/ --repo-type model --local-dir ./onnx_models
    
  • PyTorch weights (export new voices): uv sync --extra export then
    uv run hf download notmax123/blue --repo-type model --local-dir ./pt_models
    

Usage

Examples below use voices/female1.json from this repo. If you downloaded all_voices, pick paths under onnx_models/voices/all_voices/ (see manifest.tsv).

Quick start

import soundfile as sf
from blue_onnx import BlueTTS

tts = BlueTTS(
    onnx_dir="onnx_models",
    style_json="voices/female1.json",
    renikud_path="model.onnx",
)

samples, sr = tts.synthesize("שלום, זהו מודל דיבור בעברית.", lang="he")
sf.write("output.wav", samples, sr)

mixed = "שלום לכולם, <en>welcome to the presentation</en>, <es>espero que lo disfruten</es>."
samples, sr = tts.synthesize(mixed, lang="he")
sf.write("mixed_output.wav", samples, sr)

If you are editing this repo without installing the package, use from src.blue_onnx import BlueTTS (as in examples/) or put src on PYTHONPATH.

Examples

Outputs go to examples/out/ when run from the repo root.

uv run python examples/hebrew.py
uv run python examples/english.py
uv run python examples/spanish.py
uv run python examples/italian.py
uv run python examples/german.py
uv run python examples/mixed.py
uv run python examples/app.py --lang en --text "Hello world."

TensorRT (NVIDIA only)

  1. Dependencies:
uv sync --extra tensorrt
uv pip install tensorrt-cu12   # separate install; see astral-sh/uv#14313
  1. Build engines (details in scripts/README.md):
uv run python scripts/create_tensorrt.py \
  --onnx_dir onnx_models --engine_dir trt_engines --precision fp32 --config config/tts.json

Note: examples/all_langs_and_mix.py --tensorrt

Citations

@ARTICLE{2025arXiv250323108K,
       author = {{Kim}, Hyeongju and {Yang}, Jinhyeok and {Yu}, Yechan and {Ji}, Seunghun and {Morton}, Jacob and {Bous}, Frederik and {Byun}, Joon and {Lee}, Juheon},
        title = "{SupertonicTTS: Towards Highly Efficient and Streamlined Text-to-Speech System}",
      journal = {arXiv e-prints},
     keywords = {Audio and Speech Processing, Machine Learning, Sound},
        pages = {arXiv:2503.23108},
}
@article{kim2025training,
  title={Training Flow Matching Models with Reliable Labels via Self-Purification},
  author={Kim, Hyeongju and Yu, Yechan and Yi, June Young and Lee, Juheon},
  journal={arXiv preprint arXiv:2509.19091},
  year={2025}
}
@misc{yi2025robustttstrainingselfpurifying,
      title={Robust TTS Training via Self-Purifying Flow Matching for the WildSpoof 2026 TTS Track},
      author={June Young Yi and Hyeongju Kim and Juheon Lee},
      year={2025},
      eprint={2512.17293},
      archivePrefix={arXiv},
      primaryClass={cs.SD},
      url={https://arxiv.org/abs/2512.17293},
}

Acknowledgments

Hebrew G2P uses renikud. Thanks to thewh1teagle.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blue_onnx-0.2.2.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blue_onnx-0.2.2-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file blue_onnx-0.2.2.tar.gz.

File metadata

  • Download URL: blue_onnx-0.2.2.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for blue_onnx-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ca5ccb26ab190f4195052cd37584d9ae1a40c07993e5b602af6824cb955b9a52
MD5 faf1278a7301fd488c384fb88dab292d
BLAKE2b-256 dd96cc69855ea6efdb0dcb0eea43e9dd4c8ad2bb3ed39185837a3c46cb0ae108

See more details on using hashes here.

File details

Details for the file blue_onnx-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: blue_onnx-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for blue_onnx-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 44fdc2dbe976f477e512cb16624e5bfd87d3cbdb264648a6cfb7291b195c8570
MD5 4ca2e163a6994ae74e8804337589d894
BLAKE2b-256 f7fd6779653759aa3680a60858717ac4862e96bb76bf7a7e88e3e80afe81b745

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page