Views
No views yet
[!IMPORTANT] What's new in V2:
- 10,000+ Hours Data: Trained on a massive bilingual dataset for unparalleled naturalness.
- Multi-Speaker Conversation: Support for podcast-style scripts with distinct voices and emotional nuances.
- Seamless Code-switching: High-quality English integration within Vietnamese sentences.
- Instant Voice Cloning: Still supports cloning with just 3-5 seconds of audio.
1git clone https://github.com/pnnbao97/VieNeu-TTS.git
2cd VieNeu-TTS
3
4# Install uv (if you haven't)
5# Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
6# Linux/macOS: curl -LsSf https://astral.sh/uv/install.sh | sh
7
8# Install dependencies & Run
9uv sync --group gpu
10uv run vieneu-web1# Windows (Avoid llama-cpp build errors)
2pip install vieneu --extra-index-url https://pnnbao97.github.io/llama-cpp-python-v0.3.16/cpu/
3
4# Linux / MacOS
5pip install vieneu1from vieneu import Vieneu
2
3# Initialize in Standard mode (Default - Highest quality)
4tts = Vieneu(emotion="natural") # emotion="natural" (giọng tự nhiên - mặc định) hoặc "storytelling" (giọng kể chuyện)
5
6# 1. Simple synthesis (uses default Northern Female voice 'Trúc Ly')
7text = "Chào bạn. Tôi là VieNeu-TTS, tôi có thể giúp bạn đọc sách, làm chatbot thời gian thực, thậm chí clone giọng nói của bạn."
8audio = tts.infer(text=text)
9
10# Save to file
11tts.save(audio, "output_Trúc Ly.wav")
12print("💾 Saved to output_Trúc Ly.wav")
13
14# 2. Using a specific Preset Voice
15voices = tts.list_preset_voices()
16for desc, voice_id in voices:
17 print(f"Voice: {desc} (ID: {voice_id})")
18
19my_voice_id = voices[1][1] if len(voices) > 1 else voices[0][1] # Giọng Phạm Tuyên
20voice_data = tts.get_preset_voice(my_voice_id)
21
22audio_custom = tts.infer(text="Tôi đang nói bằng giọng của Bác sĩ Tuyên.", voice=voice_data)
23
24# 3. Save to file
25tts.save(audio_custom, "output_Phạm Tuyên.wav")
26print("💾 Saved to output_Phạm Tuyên.wav")docker run --gpus all -p 23333:23333 -v huggingface_cache:/root/.cache/huggingface pnnbao/vieneu-tts:latest --tunnelVieNeu-TTS-v2 model for maximum quality.bore tunnel. Check the container logs to find your public address (e.g., bore.pub:31631).pip install "vieneu[gpu]"1from vieneu import Vieneu
2import os
3
4# Configuration
5REMOTE_API_BASE = 'http://your-server-ip:23333/v1' # Or bore tunnel URL
6REMOTE_MODEL_ID = "pnnbao-ump/VieNeu-TTS-v2"
7
8# Initialization (LIGHTWEIGHT - only loads small codec locally)
9# Default emotion is "natural" (conversational) - set emotion="storytelling" for storytelling mode
10tts = Vieneu(mode='remote', api_base=REMOTE_API_BASE, model_name=REMOTE_MODEL_ID, emotion="natural")
11os.makedirs("outputs", exist_ok=True)
12
13# List remote voices
14available_voices = tts.list_preset_voices()
15for desc, name in available_voices:
16 print(f" - {desc} (ID: {name})")
17
18# Use specific voice (dynamically select second voice)
19if available_voices:
20 _, my_voice_id = available_voices[1]
21 voice_data = tts.get_preset_voice(my_voice_id)
22 audio_spec = tts.infer(text="Chào bạn, tôi đang nói bằng giọng của bác sĩ Tuyên.", voice=voice_data)
23 tts.save(audio_spec, f"outputs/remote_{my_voice_id}.wav")
24 print(f"💾 Saved synthesis to: outputs/remote_{my_voice_id}.wav")
25
26# Standard synthesis (uses default voice)
27text_input = "Chế độ remote giúp tích hợp VieNeu vào ứng dụng Web hoặc App cực nhanh mà không cần GPU tại máy khách."
28audio = tts.infer(text=text_input)
29tts.save(audio, "outputs/remote_output.wav")
30print("💾 Saved remote synthesis to: outputs/remote_output.wav")
31
32# Zero-shot voice cloning (encodes audio locally, sends codes to server)
33if os.path.exists("examples/audio_ref/example_ngoc_huyen.wav"):
34 cloned_audio = tts.infer(
35 text="Đây là giọng nói được clone và xử lý thông qua VieNeu Server.",
36 ref_audio="examples/audio_ref/example_ngoc_huyen.wav",
37 ref_text="Tác phẩm dự thi bảo đảm tính khoa học, tính đảng, tính chiến đấu, tính định hướng."
38 )
39 tts.save(cloned_audio, "outputs/remote_cloned_output.wav")
40 print("💾 Saved remote cloned voice to: outputs/remote_cloned_output.wav")| File | Gender | Accent | Description |
|---|---|---|---|
| Bình | Male | North | Male voice, North accent |
| Tuyên | Male | North | Male voice, North accent |
| Nguyên | Male | South | Male voice, South accent |
| Hương | Female | North | Female voice, North accent |
| Ngọc | Female | North | Female voice, North accent |
| Đoan | Female | South | Female voice, South accent |
| Model | Format | Device | Quality | Features |
|---|---|---|---|---|
| VieNeu-TTS-v2 | PyTorch | GPU/CPU | ⭐⭐⭐⭐⭐ | Podcast, En-Vi CS |
| VieNeu-TTS-v2 (GGUF) | GGUF Q4 | CPU | ⭐⭐⭐⭐ | Fastest CPU, Podcast |
| VieNeu-TTS-v1 | PyTorch | GPU | ⭐⭐⭐⭐ | Stable (Vi only) |
| VieNeu-TTS-0.3B | PyTorch | GPU/CPU | ⭐⭐⭐ | Legacy Ultra-Fast |
1@misc{vieneutts2026,
2 title = {VieNeu-TTS-v2: Vietnamese Text-to-Speech with Instant Voice Cloning},
3 author = {Pham Nguyen Ngoc Bao},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/pnnbao-ump/VieNeu-TTS}}
7}