Views
No views yet

[!TIP] Voice Cloning: All model variants (including GGUF) support instant voice cloning with just 3-5 seconds of reference audio.
Trên bầu trời xanh thẳm, những đám mây trắng lửng lờ trôi như những chiếc thuyền nhỏ đang lướt nhẹ theo dòng gió. Dưới mặt đất, cánh đồng lúa vàng rực trải dài tới tận chân trời, những bông lúa nghiêng mình theo từng làn gió.
1git clone https://github.com/pnnbao97/VieNeu-TTS.git
2cd VieNeu-TTS
3# Install uv (if you haven't)
4# Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
5# Linux/macOS: curl -LsSf https://astral.sh/uv/install.sh | sh
6# Install dependencies & Run
7uv sync
8uv 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# Linux / MacOS
4pip install vieneu1from vieneu import Vieneu
2import os
3# Initialization
4tts = Vieneu() # Default: 0.3B-Q4 GGUF for CPU
5os.makedirs("outputs", exist_ok=True)
6# 1. List preset voices
7available_voices = tts.list_preset_voices()
8for desc, name in available_voices:
9 print(f" - {desc} (ID: {name})")
10# 2. Use specific voice (dynamically select second voice)
11if available_voices:
12 _, my_voice_id = available_voices[1] if len(available_voices) > 1 else available_voices[0]
13 voice_data = tts.get_preset_voice(my_voice_id)
14 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)
15 tts.save(audio_spec, f"outputs/standard_{my_voice_id}.wav")
16 print(f"💾 Saved synthesis to: outputs/standard_{my_voice_id}.wav")
17# 3. Standard synthesis (uses default voice)
18text = "Xin chào, tôi là VieNeu. Tôi có thể giúp bạn đọc sách, làm chatbot thời gian thực, hoặc thậm chí clone giọng nói của bạn."
19audio = tts.infer(text=text)
20tts.save(audio, "outputs/standard_output.wav")
21print("💾 Saved synthesis to: outputs/standard_output.wav")
22# 4. Zero-shot voice cloning
23if os.path.exists("examples/audio_ref/example_ngoc_huyen.wav"):
24 cloned_audio = tts.infer(
25 text="Đây là giọng nói đã được clone thành công từ file mẫu.",
26 ref_audio="examples/audio_ref/example_ngoc_huyen.wav",
27 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."
28 )
29 tts.save(cloned_audio, "outputs/standard_cloned_output.wav")
30 print("💾 Saved cloned voice to: outputs/standard_cloned_output.wav")
31# 5. Cleanup
32tts.close()docker run --gpus all -p 23333:23333 pnnbao/vieneu-tts:serve --model pnnbao-ump/VieNeu-TTS --tunnel1from vieneu import Vieneu
2import os
3# Configuration
4REMOTE_API_BASE = 'http://your-server-ip:23333/v1' # Or bore.pub:XXXX
5REMOTE_MODEL_ID = "pnnbao-ump/VieNeu-TTS"
6# Initialization (LIGHTWEIGHT - only loads small codec locally)
7tts = Vieneu(mode='remote', api_base=REMOTE_API_BASE, model_name=REMOTE_MODEL_ID)
8os.makedirs("outputs", exist_ok=True)
9# List remote voices
10available_voices = tts.list_preset_voices()
11for desc, name in available_voices:
12 print(f" - {desc} (ID: {name})")
13# Use specific voice
14if available_voices:
15 _, my_voice_id = available_voices[1]
16 voice_data = tts.get_preset_voice(my_voice_id)
17 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)
18 tts.save(audio_spec, f"outputs/remote_{my_voice_id}.wav")
19 print(f"💾 Saved synthesis to: outputs/remote_{my_voice_id}.wav")
20# Standard synthesis
21text_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."
22audio = tts.infer(text=text_input)
23tts.save(audio, "outputs/remote_output.wav")
24print("💾 Saved remote synthesis to: outputs/remote_output.wav")
25# Zero-shot voice cloning (encodes audio locally, sends codes to server)
26if os.path.exists("examples/audio_ref/example_ngoc_huyen.wav"):
27 cloned_audio = tts.infer(
28 text="Đây là giọng nói được clone và xử lý thông qua VieNeu Server.",
29 ref_audio="examples/audio_ref/example_ngoc_huyen.wav",
30 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."
31 )
32 tts.save(cloned_audio, "outputs/remote_cloned_output.wav")
33 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 | Speed |
|---|---|---|---|---|
| VieNeu-TTS | PyTorch | GPU/CPU | ⭐⭐⭐⭐⭐ | Very Fast with lmdeploy |
| VieNeu-TTS-0.3B | PyTorch | GPU/CPU | ⭐⭐⭐⭐ | Ultra Fast (2x) |
| VieNeu-TTS-0.3B-q4-gguf | GGUF Q4 | CPU/GPU | ⭐⭐⭐ | Extreme Speed (2x) |
1@misc{vieneutts2026,
2 title = {VieNeu-TTS: 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}1@misc{neuttsair2026,
2 title = {NeuTTS Air: On-Device Speech Language Model with Instant Voice Cloning},
3 author = {Neuphonic},
4 year = {2026},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/neuphonic/neutts-air}}
7}