Skip to main content

Hebrew Text-to-Speech inference using ONNX and TensorRT

Project description

Blue

Text-to-Speech inference using ONNX Runtime with optional TensorRT acceleration.

✨ Demo

Try Live Demo on Hugging Face   lightbluetts.com

🎙️ Human-sounding TTS in Hebrew, English, Spanish, Italian & German — try samples and the live demo on the site.

Installation

Install the core dependencies:

uv sync

For CUDA (GPU) support:

uv sync --extra gpu

Download Models

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 use voices/female1.json from this repo. After the optional voice download, use paths under onnx_models/voices/all_voices/ (manifest.tsv lists them).

Here is a basic example of how to use BlueTTS in Python:

import soundfile as sf
from src.blue_onnx import BlueTTS

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

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

# Mixed languages
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)

Running Examples

You can run the provided example scripts to test the model. Outputs will be saved in the examples/out/ directory.

# Generate samples for individual languages
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

# Generate a mixed-language sample
uv run python examples/mixed.py

# Run the CLI app
uv run python examples/app.py --lang en --text "Hello world."

TensorRT (NVIDIA GPUs Only)

For faster inference on NVIDIA GPUs, you can build TensorRT engines.

  1. Install TensorRT dependencies:
uv sync --extra tensorrt
uv pip install tensorrt-cu12  # installed separately due to astral-sh/uv#14313
  1. Build the engines (see scripts/README.md for details):
uv run python scripts/create_tensorrt.py \
  --onnx_dir onnx_models --engine_dir trt_engines --precision fp16 --config config/tts.json

(Note: The examples/all_langs_and_mix.py --tensorrt flag is currently bugged).

Papers

@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

This project uses renikud for Hebrew G2P. Special thanks to thewh1teagle for his work on Hebrew phonemization.

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.1.0.tar.gz (16.5 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.1.0-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: blue_onnx-0.1.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for blue_onnx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a7e8474e5a43167cc0495a98bfa8d5c335051b2b771158c07672e1ea3d3a81b4
MD5 3bc26df3ed8a2ca22d8b0bf0f67a5561
BLAKE2b-256 220a6baa5f2303a88667a143802762d4a23fa7d7e1a2c722f9ee8cd3892b0812

See more details on using hashes here.

File details

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

File metadata

  • Download URL: blue_onnx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for blue_onnx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 39a519957c3bb6b4623320bf7f7d1ca3ee93529f3f8b2c895ece3364c44bc150
MD5 79a7daf1e6313903680d404c55fc8b30
BLAKE2b-256 4a858681494809d79f6010a9cb898595c379aa342d82567160aa2942a39953e3

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