Text-to-Speech
GGUF
Vietnamese
realtime
tts
cpu
vietnamese
pnnbao-ump commited on
Commit
06cdf1c
·
verified ·
1 Parent(s): 0e514ec

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -0
README.md CHANGED
@@ -59,6 +59,62 @@ uv run gradio_app.py
59
  ```
60
  In the UI, select **Backbone**: `VieNeu-TTS-0.3B-q8-gguf` and **Device**: `CPU`.
61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  ## 📊 Technical Specifications
63
  - **Format**: GGUF (Q8_0)
64
  - **Size**: ~300 MB
 
59
  ```
60
  In the UI, select **Backbone**: `VieNeu-TTS-0.3B-q8-gguf` and **Device**: `CPU`.
61
 
62
+ ---
63
+
64
+ ## 📦 Using Python SDK (vieneu)
65
+
66
+ Install the SDK to integrate VieNeu-TTS-0.3B into your research or applications:
67
+
68
+ ```bash
69
+ # Windows (Avoid llama-cpp build errors)
70
+ pip install vieneu --extra-index-url https://pnnbao97.github.io/llama-cpp-python-v0.3.16/cpu/
71
+
72
+ # Linux / MacOS
73
+ pip install vieneu
74
+ ```
75
+
76
+ ### Full Features Guide
77
+ ```python
78
+ from vieneu import Vieneu
79
+ import os
80
+
81
+ # Initialization
82
+ tts = Vieneu() # Default: 0.3B-Q4 GGUF for CPU
83
+ os.makedirs("outputs", exist_ok=True)
84
+
85
+ # 1. List preset voices
86
+ available_voices = tts.list_preset_voices()
87
+ for desc, name in available_voices:
88
+ print(f" - {desc} (ID: {name})")
89
+
90
+ # 2. Use specific voice (dynamically select second voice)
91
+ if available_voices:
92
+ _, my_voice_id = available_voices[1] if len(available_voices) > 1 else available_voices[0]
93
+ voice_data = tts.get_preset_voice(my_voice_id)
94
+ 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)
95
+ tts.save(audio_spec, f"outputs/standard_{my_voice_id}.wav")
96
+ print(f"💾 Saved synthesis to: outputs/standard_{my_voice_id}.wav")
97
+
98
+ # 3. Standard synthesis (uses default voice)
99
+ text = "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."
100
+ audio = tts.infer(text=text)
101
+ tts.save(audio, "outputs/standard_output.wav")
102
+ print("💾 Saved synthesis to: outputs/standard_output.wav")
103
+
104
+ # 4. Zero-shot voice cloning
105
+ if os.path.exists("examples/audio_ref/example_ngoc_huyen.wav"):
106
+ cloned_audio = tts.infer(
107
+ text="Đây là giọng nói đã được clone thành công từ file mẫu.",
108
+ ref_audio="examples/audio_ref/example_ngoc_huyen.wav",
109
+ 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."
110
+ )
111
+ tts.save(cloned_audio, "outputs/standard_cloned_output.wav")
112
+ print("💾 Saved cloned voice to: outputs/standard_cloned_output.wav")
113
+
114
+ # 5. Cleanup
115
+ tts.close()
116
+ ```
117
+
118
  ## 📊 Technical Specifications
119
  - **Format**: GGUF (Q8_0)
120
  - **Size**: ~300 MB