Views
No views yet
vieneu Python SDK (v3.3.0). Its minimal install is torch-free: on CPU everything runs on ONNX Runtime (PyTorch is never imported), and on a CUDA machine it auto-switches to the PyTorch engine with automatic batching — same API, no code change.[!IMPORTANT] What's new in SDK v3.3.0:
- 20 preset voices covering North / Central / South, both genders and several reading characters.
- Torch-free voice cloning on CPU — cloning, denoising and
add_voicenow work on the ONNX-only install (kaldi-native-fbank + soxr), no PyTorch needed.- int8 backbone by default on CPU — ~1.6× faster and ~4× smaller than fp32 with quality preserved; use
Vieneu(precision="fp32")for max fidelity.- Sliding-window repetition penalty for more stable long generations.
1git clone https://github.com/pnnbao97/VieNeu-TTS.git
2cd VieNeu-TTSuv sync⚡ Useuv sync, notpip install, for the fastest CPU inference — it reproduces the locked environment with the optimized ONNX Runtime build. On Apple Silicon this ONNX/CPU path is faster than the MPS/PyTorch build.
uv sync --group gpuuv run vieneu-webhttp://127.0.0.1:7860 with a Default voice tab, a Voice Cloning tab, and a Conversation tab (batched multi-speaker podcasts).vieneu)pip install vieneu1pip install torch==2.8.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu128
2pip install "transformers==4.57.6" # Qwen3 backbone + MOSS codec (pinned — most stable)
3pip install vieneuℹ️ When is GPU actually worth it? The GPU win comes from batching, so it only pays off on long text (many chunks generated together in one forward — long-form or bulk synthesis). For short text the torch-free CPU/ONNX path is usually faster. Use CPU for short, interactive calls; reach for GPU for long-form or high-throughput work.
1from vieneu import Vieneu
2from time import time
3
4# Default = v3 Turbo (48 kHz). CPU → ONNX (torch-free, int8); GPU → PyTorch (auto-detected).
5tts = Vieneu() # int8 backbone (default, fastest on CPU)
6# tts = Vieneu(precision="fp32") # max fidelity, slower on CPU
7
8text = """[cười] Trời ơi, cái giọng nó tự nhiên mà nó mượt mà dã man, nghe không khác gì người thật luôn. Giờ thì tha hồ mà quẩy content với cả kho giọng nói đa dạng, đủ mọi sắc thái biểu cảm. Mọi người bật loa lên rồi cùng trải nghiệm thử với mình nhé!"""
9
10# 1. Default voice (Adam) — 48 kHz, no reference needed
11start = time()
12audio = tts.infer(text)
13tts.save(audio, "output.wav")
14print(f"Time taken: {time() - start:.2f} seconds")
15
16# 2. Built-in voices by name
17for label, voice_id in tts.list_preset_voices():
18 print(label, voice_id)
19audio = tts.infer("Mình là Xuân Vĩnh nè!", voice="Xuân Vĩnh")
20tts.save(audio, "output_xuan_vinh.wav")
21
22# 3. Emotion / non-verbal cues — EXPERIMENTAL: [cười] [thở dài] [hắng giọng]
23audio = tts.infer("Nghe hay quá đi [cười]. Để mình nói tiếp [hắng giọng].", voice="Phạm Tuyên")
24
25# 4. Instant voice cloning from a 3–8s reference clip (works on the torch-free CPU install too)
26audio = tts.infer("Đây là giọng được nhân bản tức thì.", ref_audio="my_voice.wav", denoise=True)[!TIP] A temperature around 0.8 gives the most stable result for v3 Turbo. Higher values add expressiveness but can be less stable.
backend="onnx" for realtime:1vieneu = Vieneu(backend="onnx") # force ONNX/CPU — the streaming path (int8)
2for chunk in vieneu.infer_stream("Xin chào các bạn!", voice="Adam"):
3 play(chunk) # np.float32 @ 48 kHz, play/write as it arrivesapps/web_stream.py.infer_batch() runs many texts in one batched forward — same API on every backend (on CPU it still works, just sequentially). The batch caps at max_batch_size (default 32); pass batch_size=1 to disable. A single long infer() also auto-batches its own chunks.audios = vieneu.infer_batch(texts, voice="Adam") # or infer_batch(..., batch_size=64)1# Clone from a 3–8s clip; the reference is auto-denoised and trimmed to ≤ 8s
2audio = vieneu.infer("Chào bạn, đây là giọng của tôi.", ref_audio="voice.wav", denoise=True)
3
4# Enroll once, then reuse by name like a built-in voice
5vieneu.add_voice("Giọng của tôi", "voice.wav")
6audio = vieneu.infer("Câu này dùng giọng đã lưu.", voice="Giọng của tôi")
7
8# Just clean up a clip (no synthesis)
9wav, sr = vieneu.denoise("noisy.wav", out_path="clean.wav")denoise,add_voiceand cloning work on every backend, including the torch-free CPU/ONNX install.
style is still accepted by infer, infer_stream, infer_batch and add_voice so existing code keeps running, but it is ignored on v3 Turbo: the reading style is already baked into the reference itself (the speaker embedding + reference codes of the preset voice or of your cloned clip). Pick the reading character through the voice instead.voice="<name>" — no reference audio required.| Voice | Region | Character | Voice | Region | Character | |
|---|---|---|---|---|---|---|
| Adam | Nam | Natural | Quang Sơn | Trung | Natural | |
| Phạm Tuyên | Bắc | Natural | Ngọc Trân | Trung | Natural | |
| Minh Đức | Bắc | News | Xuân Vĩnh | Nam | Natural | |
| Thanh Bình | Bắc | Storytelling | Thái Sơn | Nam | Storytelling | |
| Ngọc Huyền | Bắc | Natural | Minh Triết | Nam | News | |
| Trúc Ly | Bắc | Natural | Đức Trí | Nam | Audiobook | |
| Đoan Trang | Bắc | Natural | Thục Đoan | Nam | Storytelling | |
| Ngọc Linh | Bắc | Storytelling | Thùy Dung | Nam | News | |
| Mai Anh | Bắc | News | Mỹ Duyên | Nam | Audiobook | |
| Quỳnh Anh | Bắc | Audiobook | Kim Thanh | Nam | Audiobook |
ref_audio="...").| Model | Format | Device | Sample Rate | Quality | Features |
|---|---|---|---|---|---|
| VieNeu-TTS-v3-Turbo (default) | ONNX (CPU) / PyTorch (GPU) | CPU/GPU | 48 kHz | ⭐⭐⭐⭐⭐ | 20 preset voices, cloning, streaming, emotion cues, conversation |
| VieNeu-TTS-v2 | PyTorch | GPU/CPU | 24 kHz | ⭐⭐⭐⭐⭐ | Podcast, En-Vi code-switching |
| VieNeu-TTS-v2 (GGUF) | GGUF Q4 | CPU | 24 kHz | ⭐⭐⭐⭐ | Fastest on CPU, Podcast |
| VieNeu-TTS-v1 | PyTorch | GPU | 24 kHz | ⭐⭐⭐⭐ | Stable (Vi only) |
model.safetensors, the ONNX exports, configs and tokenizers, and the bundled preset-voice assets (speaker embeddings + reference codes in voices_v3_turbo.json).vieneu.list_preset_voices() at the version you have installed. This card documents SDK v3.3.0 (20 voices, default Adam); earlier revisions shipped fewer voices under partly different names, so pin the SDK version if the exact roster matters to you.[!WARNING] Voice cloning is your responsibility. The consent confirmation above covers the bundled preset voices only. If you clone a voice from your own reference clip, you must have the right to use that person's voice. Do not clone real people without their permission, and do not use this model to impersonate, defraud, or produce misleading content.
1@misc{vieneutts2026,
2 title = {VieNeu-TTS v3 Turbo: 48kHz Vietnamese Text-to-Speech with Instant Voice Cloning and Emotion Control},
3 author = {Pham Nguyen Ngoc Bao},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/pnnbao-ump/VieNeu-TTS-v3-Turbo}}
7}