blue-onnx 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blue_onnx-0.1.0/PKG-INFO +175 -0
- blue_onnx-0.1.0/README.md +148 -0
- blue_onnx-0.1.0/pyproject.toml +56 -0
- blue_onnx-0.1.0/src/blue_onnx/__init__.py +462 -0
- blue_onnx-0.1.0/src/blue_onnx/_blue_vocab.py +361 -0
- blue_onnx-0.1.0/src/blue_onnx/_common.py +240 -0
blue_onnx-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: blue-onnx
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Hebrew Text-to-Speech inference using ONNX and TensorRT
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Requires-Dist: numpy
|
|
7
|
+
Requires-Dist: onnxruntime
|
|
8
|
+
Requires-Dist: soundfile
|
|
9
|
+
Requires-Dist: huggingface-hub>=0.26.0
|
|
10
|
+
Requires-Dist: renikud-onnx
|
|
11
|
+
Requires-Dist: phonemizer-fork>=3.3.2
|
|
12
|
+
Requires-Dist: espeakng-loader>=0.2.4
|
|
13
|
+
Requires-Dist: bluecodec ; extra == 'export'
|
|
14
|
+
Requires-Dist: librosa ; extra == 'export'
|
|
15
|
+
Requires-Dist: onnx>=1.17.0 ; extra == 'export'
|
|
16
|
+
Requires-Dist: onnxslim>=0.1.0 ; extra == 'export'
|
|
17
|
+
Requires-Dist: safetensors>=0.4.0 ; extra == 'export'
|
|
18
|
+
Requires-Dist: torch>=2.1.0 ; extra == 'export'
|
|
19
|
+
Requires-Dist: torchaudio>=2.1.0 ; extra == 'export'
|
|
20
|
+
Requires-Dist: onnxruntime-gpu ; extra == 'gpu'
|
|
21
|
+
Requires-Dist: torch>=2.1.0 ; extra == 'tensorrt'
|
|
22
|
+
Requires-Python: >=3.12
|
|
23
|
+
Provides-Extra: export
|
|
24
|
+
Provides-Extra: gpu
|
|
25
|
+
Provides-Extra: tensorrt
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# Blue
|
|
29
|
+
|
|
30
|
+
Text-to-Speech inference using ONNX Runtime with optional TensorRT acceleration.
|
|
31
|
+
|
|
32
|
+
## ✨ Demo
|
|
33
|
+
|
|
34
|
+
<p align="center">
|
|
35
|
+
<a href="https://huggingface.co/spaces/notmax123/Blue"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Try%20Live%20Demo-FFD21E?style=for-the-badge" alt="Try Live Demo on Hugging Face"></a>
|
|
36
|
+
|
|
37
|
+
<a href="https://lightbluetts.com/"><img src="https://img.shields.io/badge/%F0%9F%8C%90%20Website-lightbluetts.com-2563EB?style=for-the-badge" alt="lightbluetts.com"></a>
|
|
38
|
+
</p>
|
|
39
|
+
<p align="center">🎙️ Human-sounding TTS in <b>Hebrew</b>, <b>English</b>, <b>Spanish</b>, <b>Italian</b> & <b>German</b> — try samples and the live demo on the site.</p>
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
Install the core dependencies:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
uv sync
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
For CUDA (GPU) support:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
uv sync --extra gpu
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Download Models
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv run hf download notmax123/blue-onnx --repo-type model --local-dir ./onnx_models \
|
|
59
|
+
--exclude "voices/all_voices/**"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Optional:
|
|
63
|
+
|
|
64
|
+
- Hebrew G2P:
|
|
65
|
+
```bash
|
|
66
|
+
wget -O model.onnx https://huggingface.co/thewh1teagle/renikud/resolve/main/model.onnx
|
|
67
|
+
```
|
|
68
|
+
- [2000+ voice JSONs](https://huggingface.co/notmax123/blue-onnx/tree/main/voices/all_voices):
|
|
69
|
+
```bash
|
|
70
|
+
uv run hf download notmax123/blue-onnx voices/all_voices/ --repo-type model --local-dir ./onnx_models
|
|
71
|
+
```
|
|
72
|
+
- PyTorch weights (export new voices): `uv sync --extra export` then
|
|
73
|
+
```bash
|
|
74
|
+
uv run hf download notmax123/blue --repo-type model --local-dir ./pt_models
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Usage
|
|
78
|
+
|
|
79
|
+
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).
|
|
80
|
+
|
|
81
|
+
Here is a basic example of how to use `BlueTTS` in Python:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
import soundfile as sf
|
|
85
|
+
from src.blue_onnx import BlueTTS
|
|
86
|
+
|
|
87
|
+
tts = BlueTTS(
|
|
88
|
+
onnx_dir="onnx_models",
|
|
89
|
+
style_json="voices/female1.json",
|
|
90
|
+
renikud_path="model.onnx",
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Single language
|
|
94
|
+
samples, sr = tts.synthesize("שלום, זהו מודל דיבור בעברית.", lang="he")
|
|
95
|
+
sf.write("output.wav", samples, sr)
|
|
96
|
+
|
|
97
|
+
# Mixed languages
|
|
98
|
+
mixed = "שלום לכולם, <en>welcome to the presentation</en>, <es>espero que lo disfruten</es>."
|
|
99
|
+
samples, sr = tts.synthesize(mixed, lang="he")
|
|
100
|
+
sf.write("mixed_output.wav", samples, sr)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Running Examples
|
|
104
|
+
|
|
105
|
+
You can run the provided example scripts to test the model. Outputs will be saved in the `examples/out/` directory.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
# Generate samples for individual languages
|
|
109
|
+
uv run python examples/hebrew.py
|
|
110
|
+
uv run python examples/english.py
|
|
111
|
+
uv run python examples/spanish.py
|
|
112
|
+
uv run python examples/italian.py
|
|
113
|
+
uv run python examples/german.py
|
|
114
|
+
|
|
115
|
+
# Generate a mixed-language sample
|
|
116
|
+
uv run python examples/mixed.py
|
|
117
|
+
|
|
118
|
+
# Run the CLI app
|
|
119
|
+
uv run python examples/app.py --lang en --text "Hello world."
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## TensorRT (NVIDIA GPUs Only)
|
|
123
|
+
|
|
124
|
+
For faster inference on NVIDIA GPUs, you can build TensorRT engines.
|
|
125
|
+
|
|
126
|
+
1. Install TensorRT dependencies:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
uv sync --extra tensorrt
|
|
130
|
+
uv pip install tensorrt-cu12 # installed separately due to astral-sh/uv#14313
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
2. Build the engines (see `scripts/README.md` for details):
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
uv run python scripts/create_tensorrt.py \
|
|
137
|
+
--onnx_dir onnx_models --engine_dir trt_engines --precision fp16 --config config/tts.json
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
*(Note: The `examples/all_langs_and_mix.py --tensorrt` flag is currently bugged).*
|
|
141
|
+
|
|
142
|
+
## Papers
|
|
143
|
+
|
|
144
|
+
```bibtex
|
|
145
|
+
@ARTICLE{2025arXiv250323108K,
|
|
146
|
+
author = {{Kim}, Hyeongju and {Yang}, Jinhyeok and {Yu}, Yechan and {Ji}, Seunghun and {Morton}, Jacob and {Bous}, Frederik and {Byun}, Joon and {Lee}, Juheon},
|
|
147
|
+
title = "{SupertonicTTS: Towards Highly Efficient and Streamlined Text-to-Speech System}",
|
|
148
|
+
journal = {arXiv e-prints},
|
|
149
|
+
keywords = {Audio and Speech Processing, Machine Learning, Sound},
|
|
150
|
+
pages = {arXiv:2503.23108},
|
|
151
|
+
}
|
|
152
|
+
@article{kim2025training,
|
|
153
|
+
title={Training Flow Matching Models with Reliable Labels via Self-Purification},
|
|
154
|
+
author={Kim, Hyeongju and Yu, Yechan and Yi, June Young and Lee, Juheon},
|
|
155
|
+
journal={arXiv preprint arXiv:2509.19091},
|
|
156
|
+
year={2025}
|
|
157
|
+
}
|
|
158
|
+
@misc{yi2025robustttstrainingselfpurifying,
|
|
159
|
+
title={Robust TTS Training via Self-Purifying Flow Matching for the WildSpoof 2026 TTS Track},
|
|
160
|
+
author={June Young Yi and Hyeongju Kim and Juheon Lee},
|
|
161
|
+
year={2025},
|
|
162
|
+
eprint={2512.17293},
|
|
163
|
+
archivePrefix={arXiv},
|
|
164
|
+
primaryClass={cs.SD},
|
|
165
|
+
url={https://arxiv.org/abs/2512.17293},
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Acknowledgments
|
|
170
|
+
|
|
171
|
+
This project uses [renikud](https://github.com/thewh1teagle/renikud) for Hebrew G2P. Special thanks to [thewh1teagle](https://github.com/thewh1teagle) for his work on Hebrew phonemization.
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
MIT
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Blue
|
|
2
|
+
|
|
3
|
+
Text-to-Speech inference using ONNX Runtime with optional TensorRT acceleration.
|
|
4
|
+
|
|
5
|
+
## ✨ Demo
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://huggingface.co/spaces/notmax123/Blue"><img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Try%20Live%20Demo-FFD21E?style=for-the-badge" alt="Try Live Demo on Hugging Face"></a>
|
|
9
|
+
|
|
10
|
+
<a href="https://lightbluetts.com/"><img src="https://img.shields.io/badge/%F0%9F%8C%90%20Website-lightbluetts.com-2563EB?style=for-the-badge" alt="lightbluetts.com"></a>
|
|
11
|
+
</p>
|
|
12
|
+
<p align="center">🎙️ Human-sounding TTS in <b>Hebrew</b>, <b>English</b>, <b>Spanish</b>, <b>Italian</b> & <b>German</b> — try samples and the live demo on the site.</p>
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
Install the core dependencies:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
uv sync
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For CUDA (GPU) support:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv sync --extra gpu
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Download Models
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
uv run hf download notmax123/blue-onnx --repo-type model --local-dir ./onnx_models \
|
|
32
|
+
--exclude "voices/all_voices/**"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Optional:
|
|
36
|
+
|
|
37
|
+
- Hebrew G2P:
|
|
38
|
+
```bash
|
|
39
|
+
wget -O model.onnx https://huggingface.co/thewh1teagle/renikud/resolve/main/model.onnx
|
|
40
|
+
```
|
|
41
|
+
- [2000+ voice JSONs](https://huggingface.co/notmax123/blue-onnx/tree/main/voices/all_voices):
|
|
42
|
+
```bash
|
|
43
|
+
uv run hf download notmax123/blue-onnx voices/all_voices/ --repo-type model --local-dir ./onnx_models
|
|
44
|
+
```
|
|
45
|
+
- PyTorch weights (export new voices): `uv sync --extra export` then
|
|
46
|
+
```bash
|
|
47
|
+
uv run hf download notmax123/blue --repo-type model --local-dir ./pt_models
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
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).
|
|
53
|
+
|
|
54
|
+
Here is a basic example of how to use `BlueTTS` in Python:
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import soundfile as sf
|
|
58
|
+
from src.blue_onnx import BlueTTS
|
|
59
|
+
|
|
60
|
+
tts = BlueTTS(
|
|
61
|
+
onnx_dir="onnx_models",
|
|
62
|
+
style_json="voices/female1.json",
|
|
63
|
+
renikud_path="model.onnx",
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
# Single language
|
|
67
|
+
samples, sr = tts.synthesize("שלום, זהו מודל דיבור בעברית.", lang="he")
|
|
68
|
+
sf.write("output.wav", samples, sr)
|
|
69
|
+
|
|
70
|
+
# Mixed languages
|
|
71
|
+
mixed = "שלום לכולם, <en>welcome to the presentation</en>, <es>espero que lo disfruten</es>."
|
|
72
|
+
samples, sr = tts.synthesize(mixed, lang="he")
|
|
73
|
+
sf.write("mixed_output.wav", samples, sr)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Running Examples
|
|
77
|
+
|
|
78
|
+
You can run the provided example scripts to test the model. Outputs will be saved in the `examples/out/` directory.
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# Generate samples for individual languages
|
|
82
|
+
uv run python examples/hebrew.py
|
|
83
|
+
uv run python examples/english.py
|
|
84
|
+
uv run python examples/spanish.py
|
|
85
|
+
uv run python examples/italian.py
|
|
86
|
+
uv run python examples/german.py
|
|
87
|
+
|
|
88
|
+
# Generate a mixed-language sample
|
|
89
|
+
uv run python examples/mixed.py
|
|
90
|
+
|
|
91
|
+
# Run the CLI app
|
|
92
|
+
uv run python examples/app.py --lang en --text "Hello world."
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## TensorRT (NVIDIA GPUs Only)
|
|
96
|
+
|
|
97
|
+
For faster inference on NVIDIA GPUs, you can build TensorRT engines.
|
|
98
|
+
|
|
99
|
+
1. Install TensorRT dependencies:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
uv sync --extra tensorrt
|
|
103
|
+
uv pip install tensorrt-cu12 # installed separately due to astral-sh/uv#14313
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
2. Build the engines (see `scripts/README.md` for details):
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
uv run python scripts/create_tensorrt.py \
|
|
110
|
+
--onnx_dir onnx_models --engine_dir trt_engines --precision fp16 --config config/tts.json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
*(Note: The `examples/all_langs_and_mix.py --tensorrt` flag is currently bugged).*
|
|
114
|
+
|
|
115
|
+
## Papers
|
|
116
|
+
|
|
117
|
+
```bibtex
|
|
118
|
+
@ARTICLE{2025arXiv250323108K,
|
|
119
|
+
author = {{Kim}, Hyeongju and {Yang}, Jinhyeok and {Yu}, Yechan and {Ji}, Seunghun and {Morton}, Jacob and {Bous}, Frederik and {Byun}, Joon and {Lee}, Juheon},
|
|
120
|
+
title = "{SupertonicTTS: Towards Highly Efficient and Streamlined Text-to-Speech System}",
|
|
121
|
+
journal = {arXiv e-prints},
|
|
122
|
+
keywords = {Audio and Speech Processing, Machine Learning, Sound},
|
|
123
|
+
pages = {arXiv:2503.23108},
|
|
124
|
+
}
|
|
125
|
+
@article{kim2025training,
|
|
126
|
+
title={Training Flow Matching Models with Reliable Labels via Self-Purification},
|
|
127
|
+
author={Kim, Hyeongju and Yu, Yechan and Yi, June Young and Lee, Juheon},
|
|
128
|
+
journal={arXiv preprint arXiv:2509.19091},
|
|
129
|
+
year={2025}
|
|
130
|
+
}
|
|
131
|
+
@misc{yi2025robustttstrainingselfpurifying,
|
|
132
|
+
title={Robust TTS Training via Self-Purifying Flow Matching for the WildSpoof 2026 TTS Track},
|
|
133
|
+
author={June Young Yi and Hyeongju Kim and Juheon Lee},
|
|
134
|
+
year={2025},
|
|
135
|
+
eprint={2512.17293},
|
|
136
|
+
archivePrefix={arXiv},
|
|
137
|
+
primaryClass={cs.SD},
|
|
138
|
+
url={https://arxiv.org/abs/2512.17293},
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Acknowledgments
|
|
143
|
+
|
|
144
|
+
This project uses [renikud](https://github.com/thewh1teagle/renikud) for Hebrew G2P. Special thanks to [thewh1teagle](https://github.com/thewh1teagle) for his work on Hebrew phonemization.
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
MIT
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "blue-onnx"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Hebrew Text-to-Speech inference using ONNX and TensorRT"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
requires-python = ">=3.12"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"numpy",
|
|
10
|
+
"onnxruntime",
|
|
11
|
+
"soundfile",
|
|
12
|
+
"huggingface-hub>=0.26.0",
|
|
13
|
+
"renikud-onnx",
|
|
14
|
+
"phonemizer-fork>=3.3.2",
|
|
15
|
+
"espeakng-loader>=0.2.4",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[project.optional-dependencies]
|
|
19
|
+
gpu = [
|
|
20
|
+
"onnxruntime-gpu",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
# PyPI `tensorrt` defaults to CUDA 13 wheels; most driver stacks still report CUDA 12.x.
|
|
24
|
+
# Use `tensorrt-cu13` instead if your driver/toolkit is CUDA 13+.
|
|
25
|
+
tensorrt = [
|
|
26
|
+
# "tensorrt-cu12; sys_platform == 'linux'", # see astral-sh/uv#14313
|
|
27
|
+
"torch>=2.1.0",
|
|
28
|
+
]
|
|
29
|
+
export = [
|
|
30
|
+
"bluecodec",
|
|
31
|
+
"librosa",
|
|
32
|
+
"onnx>=1.17.0",
|
|
33
|
+
"onnxslim>=0.1.0",
|
|
34
|
+
"safetensors>=0.4.0",
|
|
35
|
+
"torch>=2.1.0",
|
|
36
|
+
"torchaudio>=2.1.0",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[tool.uv]
|
|
40
|
+
# Repo is scripts + src packages, not a single importable `blue` package tree (avoids uv_build errors).
|
|
41
|
+
package = false
|
|
42
|
+
|
|
43
|
+
[tool.uv.sources]
|
|
44
|
+
bluecodec = { git = "https://github.com/maxmelichov/blue-codec.git" }
|
|
45
|
+
|
|
46
|
+
[tool.pyright]
|
|
47
|
+
# `models.*` lives under training/; same layout as PYTHONPATH=training for scripts/export_onnx.py
|
|
48
|
+
extraPaths = ["training"]
|
|
49
|
+
|
|
50
|
+
[build-system]
|
|
51
|
+
requires = ["uv_build>=0.9.13,<0.10.0"]
|
|
52
|
+
build-backend = "uv_build"
|
|
53
|
+
|
|
54
|
+
dev = [
|
|
55
|
+
"ruff",
|
|
56
|
+
]
|