Text-to-Speech
Vietnamese
vietnamese
female
male
voice-cloning
File size: 14,480 Bytes
47a8447
b9cc744
47a8447
 
 
 
 
8af2c33
 
 
 
 
 
 
b9cc744
 
47a8447
 
ca2c873
 
 
 
dcbda09
ca2c873
c5cd290
ca2c873
97a7036
61a44ba
5c314cc
61a44ba
 
97a7036
 
 
e05f58f
97a7036
 
8497e8d
 
bcdbc3a
510a27d
bfeabb5
510a27d
815b16b
4d182f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d5c1f15
4d182f3
 
b812149
4d182f3
 
 
 
 
 
 
 
d5c1f15
4d182f3
 
b812149
4d182f3
 
 
 
 
 
 
caebdc2
 
 
 
510a27d
 
b4a4c49
510a27d
 
ca2c873
 
65b7bb2
784c9e1
82f7442
65b7bb2
1b8f872
 
 
 
 
 
 
d9d873c
ca2c873
510a27d
 
 
 
 
 
 
 
 
 
 
 
ca2c873
510a27d
 
ca2c873
510a27d
 
 
 
476abb9
510a27d
476abb9
510a27d
 
 
 
 
ca2c873
510a27d
 
 
5bf2464
ca2c873
 
510a27d
 
ca2c873
510a27d
ca2c873
 
510a27d
 
 
ca2c873
 
510a27d
 
ca2c873
510a27d
ca2c873
510a27d
 
ca2c873
510a27d
 
ca2c873
510a27d
 
 
ca2c873
 
510a27d
ca2c873
510a27d
ca2c873
510a27d
ca2c873
d327eb2
510a27d
 
 
ca2c873
510a27d
ca2c873
510a27d
 
b4a4c49
7e73254
6ba7e0c
636f71f
 
9c07929
 
374667b
 
 
 
 
636f71f
 
 
 
74ee6fe
636f71f
 
 
 
 
440ce03
636f71f
05deb0f
51db5cc
05deb0f
 
 
 
 
 
51db5cc
05deb0f
51db5cc
05deb0f
51db5cc
538ae41
20a90db
 
636f71f
538ae41
636f71f
 
 
fe9e9e2
510a27d
 
 
a817fe9
510a27d
 
 
 
fe9e9e2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
---
license: cc-by-nc-4.0
language:
- vi
base_model:
- SWivid/F5-TTS
pipeline_tag: text-to-speech
new_version: erax-ai/EraX-Smile-Female-F5-V1.0
tags:
- text-to-speech
- vietnamese
- female
- male
- voice-cloning
datasets:
- amphion/Emilia-Dataset
---

<p align="left">
  <img src="https://cdn-uploads.huggingface.co/production/uploads/63d8d8879dfcfa941d4d7cd9/GsQKdaTyn2FFx_cZvVHk3.png" alt="Logo">
</p>

# EraX-Smile-Female-F5-V1.0: Giving F5-TTS a Vietnamese Twist (with Online Zero-Shot Voice Cloning!) ✨

Hey there, fellow Vietnamese AI explorers! 👋

This model is built upon the fantastic F5-TTS architecture (arXiv:2410.06885). To teach it the beautiful nuances of Vietnamese, we embarked on a fine-tuning adventure using a pretty hefty dataset: over 800,000 samples! This includes a mix of public data and a significant 500-hour private dataset (we're incredibly grateful for the usage rights! 🙏).

# Unfortunelately...

The base F5-TTS model was **pretrained with Emilia dataset which is under BY-NC 4.0 license (non-commercial)**. Sorry for any inconvenient.

**Training Journey:**

This model has been putting in the work! As of March 30th, 2024 (17:00), it's powered through approximately **420,000 update steps**... and the training wheels are still spinning! ⚙️
Our current goal is to reach **the 1 million update step milestone**. We plan to upload checkpoints roughly every 100,000 steps from now on, so keep checking back for the latest updates! 👀
It's been quite the ride – almost a full week of number crunching, complete with the occasional fiery crash and burn 🔥😅, but we're super proud of how far it's come!

Our hope is that EraX-Smile-Female-F5-V1.0 (soon UniSex) proves to be a useful contribution to the community for ethical and creative purposes.

## Does it actually work? Let's listen! 🎧

Okay, moment of truth. Here's a sample voice we fed into the model (the "reference"):

<!DOCTYPE html>
<html>
<head>
  <title>Voice Cloning Samples</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      max-width: 800px;
      margin: 0 auto;
      padding: 20px;
    }
    .audio-container {
      margin-bottom: 30px;
      padding: 15px;
      border: 1px solid #e0e0e0;
      border-radius: 8px;
      background-color: #f9f9f9;
    }
    h2 {
      color: #333;
    }
    audio {
      width: 100%;
      margin: 10px 0;
    }
    .description {
      margin-top: 5px;
      color: #555;
    }
  </style>
</head>
<body>
  <h1>Voice Cloning Samples</h1>
  
  <div class="audio-container">
    <h2>Reference Audio</h2>
    <audio controls>
      <source src="https://huggingface.co/erax-ai/EraX-Smile-Female-F5-V1.0/resolve/main/update_213000_ref.wav" type="audio/wav">
      Your browser does not support the audio element.
    </audio>
    <div class="description">
      <strong>Text:</strong> "Thậm chí không ăn thì cũng có cảm giác rất là cứng bụng, chủ yếu là cái phần rốn...trở lên. Em có cảm giác khó thở, và ngủ cũng không ngon, thường bị ợ hơi rất là nhiều"
    </div>
  </div>
  
  <div class="audio-container">
    <h2>Generated Audio Sample 1</h2>
    <audio controls>
      <source src="https://huggingface.co/erax-ai/EraX-Smile-Female-F5-V1.0/resolve/main/generated_429000.wav?raw=true" type="audio/wav">
      Your browser does not support the audio element.
    </audio>
    <a href="https://huggingface.co/erax-ai/EraX-Smile-Female-F5-V1.0/resolve/main/generated_429000.wav">Download and play generated audio. Only Safari browser allows multi playable audios.</a>
    <div class="description">
      <strong>Text:</strong> "Trong khi đó, tại một chung cư trên địa bàn P.Vĩnh Tuy (Q.Hoàng Mai), nhiều người sống trên tầng cao giật mình khi thấy rung lắc mạnh nên đã chạy xuống sảnh tầng 1. Cư dân tại đây cho biết, họ chưa bao giờ cảm thấy ảnh hưởng của động đất mạnh như hôm nay"
    </div>
  </div>
  
  <div class="audio-container">
    <h2>Generated Audio Sample 2</h2>
    <audio controls>
      <source src="https://huggingface.co/erax-ai/EraX-Smile-Female-F5-V1.0/resolve/main/generated_429000_long.wav?raw=true" type="audio/wav">
      Your browser does not support the audio element.
    </audio>
    <a href="https://huggingface.co/erax-ai/EraX-Smile-Female-F5-V1.0/resolve/main/generated_429000_long.wav?raw=true">Download and play generated audio. Only Safari browser allows multi playable audios.</a>
    <div class="description">
      <strong>Text:</strong> "Tại lễ xuất quân, Thứ trưởng Lê Văn Tuyến cho hay chiều 28.3, Myanmar đã trải qua thảm kịch động đất mạnh nhất từ trước tới nay, gây thiệt hại lớn về người và tài sản, gây ra nhiều dư chấn tại Thái Lan, Ấn Độ và Trung Quốc... Tính đến ngày 29.3, đã có hơn 1.000 người thiệt mạng và hơn 2.300 người bị thương, nhiều người còn mất tích và ước tính con số thương vong sẽ tiếp tục tăng lên"
    </div>
  </div>
</body>
</html>

  Just a gentle observation regarding the **selected reference audio** – it seems there might be a **noticeable pause** within it. Please be aware that the zero-shot cloning process will likely replicate this characteristic in the synthesized output. If a more continuous flow without pauses is desired, you might consider using a reference recording that is clean and free of significant delays, unless reproducing the pause is intentional.



## Wanna try this magic (or madness) yourself? 🧙‍♂️

The code that wrangles this thing lives over on our GitHub: ([EraX Smile Github](https://github.com/EraX-JS-Company/EraX-Smile-F5TTS)). Give it a visit!

Getting started is hopefully not *too* painful. After downloading this repo and cloning our GitHub, you can try something like this:

```python
# Ubuntu: sudo apt install ffmpeg
# Windows please refer to https://www.geeksforgeeks.org/how-to-install-ffmpeg-on-windows/
# Download out Github codes

pip install numpy==1.24
pip install matplotlib
pip install vinorm
pip install f5-tts
pip install librosa
```

```python
import os
os.environ["CUDA_VISIBLE_DEVICES"] =  "0" # Tell it which GPU to use (or ignore if you're CPU-bound and patient!)

from vinorm import TTSnorm # Gotta normalize that Vietnamese text first
from f5tts_wrapper import F5TTSWrapper # Our handy wrapper class

# --- Config ---
# Path to the model checkpoint you downloaded from *this* repo
# MAKE SURE this path points to the actual .pth or .ckpt file!
eraX_ckpt_path = "path/to/your/downloaded/EraX-Smile-Female-F5-V1.0/model.pth" # <-- CHANGE THIS!

# Path to the voice you want to clone
ref_audio_path = "path/to/your/reference_voice.wav" # <-- CHANGE THIS!

# Path to the vocab file from this repo
vocab_file = "path/to/your/downloaded/EraX-Smile-Female-F5-V1.0/vocab.txt" # <-- CHANGE THIS!

# Where to save the generated sound
output_dir = "output_audio"

# --- Texts ---
# Text matching the reference audio (helps the model learn the voice). Please make sure it match with the referrence audio!
ref_text = "Thậm chí không ăn thì cũng có cảm giác rất là cứng bụng, chủ yếu là cái phần rốn...trở lên. Em có cảm giác khó thở, và ngủ cũng không ngon, thường bị ợ hơi rất là nhiều"

# The text you want the cloned voice to speak
text_to_generate = "Trong khi đó, tại một chung cư trên địa bàn P.Vĩnh Tuy (Q.Hoàng Mai), nhiều người sống trên tầng cao giật mình khi thấy rung lắc mạnh nên đã chạy xuống sảnh tầng 1. Cư dân tại đây cho biết, họ chưa bao giờ cảm thấy ảnh hưởng của động đất mạnh như hôm nay."

# --- Let's Go! ---
print("Initializing the TTS engine... (Might take a sec)")
tts = F5TTSWrapper(
    vocoder_name="vocos", # Using Vocos vocoder
    ckpt_path=eraX_ckpt_path,
    vocab_file=vocab_file,
    use_ema=False, # ALWAYS False as we converted from .pt to safetensors and EMA (where there is or not) was in there
)

# Normalize the reference text (makes it easier for the model)
ref_text_norm = TTSnorm(ref_text)

# Prepare the output folder
os.makedirs(output_dir, exist_ok=True)

print("Processing the reference voice...")
# Feed the model the reference voice ONCE
# Provide ref_text for better quality, or set ref_text="" to use Whisper for auto-transcription (if installed)
tts.preprocess_reference(
    ref_audio_path=ref_audio_path,
    ref_text=ref_text_norm,
    clip_short=True # Keeps reference audio to a manageable length (~12s)
)
print(f"Reference audio duration used: {tts.get_current_audio_length():.2f} seconds")

# --- Generate New Speech ---
print("Generating new speech with the cloned voice...")

# Normalize the text we want to speak
text_norm = TTSnorm(text_to_generate)

# You can generate multiple sentences easily
# Just add more normalized strings to this list
sentences = [text_norm]

for i, sentence in enumerate(sentences):
    output_path = os.path.join(output_dir, f"generated_speech_{i+1}.wav")

    # THE ACTUAL GENERATION HAPPENS HERE!
    tts.generate(
        text=sentence,
        output_path=output_path,
        nfe_step=32,               # Denoising steps. More = slower but potentially better? (Default: 32)
        cfg_strength=2.0,          # How strongly to stick to the reference voice style? (Default: 2.0)
        speed=1.0,                 # Make it talk faster or slower (Default: 1.0)
        cross_fade_duration=0.15,  # Smooths transitions if text is split into chunks (Default: 0.15)
    )
    print(f"Boom! Audio saved to: {output_path}")

print("\nAll done! Check your output folder.")
```

* For full Web interface and control with Gradio, please clone and use the original repository of [F5-TTS Github](https://github.com/SWivid/F5-TTS)
* We use the cool library from [Vinorm Team](https://github.com/v-nhandt21/Vinorm) for Vietnamese text normalization.

* **What's Next?** 🤔
The EraX Team (that's us!) are always tinkering and trying to make things better (or at least, less broken!).
We hope to bring more updates your way. Let us know what you think – feedback, bug reports, or even just saying hi is always welcome!
```
- [ ] ⭐ Release checkpoints for Vietnamese male
- [ ] 📝 Codes for real-time TTS streaming
- [ ] 🔥 Release Piper-based model that can run on ...Rasberry Pi 4 🔥
```

⚠️ **Important Note on Responsible Use** ⚠️
- Voice cloning technology is powerful and comes with significant ethical responsibilities.
- Intended Use: This model is intended for creative purposes, accessibility tools, personal projects, and applications where consent is explicit and ethical considerations are prioritized.
- **Prohibited Use**: We strongly condemn and strictly prohibit the use of this model for any malicious or unethical purposes, including but not limited to:
  - Creating non-consensual deepfakes or impersonating individuals without permission.
  - Generating misinformation, fraudulent content, or defamatory material.
  - Harassment, abuse, or any form of criminal activity.
- User Responsibility: By using this model, you agree to do so responsibly and ethically. You are solely responsible for the content you generate and ensuring it complies with all applicable laws and ethical standards. The creators (EraX Team) disavow any responsibility for misuse of this model.

  Please use this technology thoughtfully and ethically.

⚠️ **Lưu ý Quan trọng về Việc Sử dụng có Trách nhiệm** ⚠️

- Sức mạnh và Trách nhiệm: Công nghệ nhân bản giọng nói sở hữu sức mạnh to lớn và đi kèm với những trách nhiệm đạo đức hết sức quan trọng.
- Mục đích Sử dụng Dự kiến: Mô hình này được tạo ra nhằm phục vụ các mục đích sáng tạo, phát triển công cụ hỗ trợ tiếp cận, thực hiện dự án cá nhân và các ứng dụng khác nơi có sự đồng thuận rõ ràng từ các bên liên quan và các yếu tố đạo đức luôn được đặt lên hàng đầu.
- Nghiêm cấm Sử dụng Sai trái: Chúng tôi cực lực lên án và nghiêm cấm tuyệt đối việc sử dụng mô hình này cho bất kỳ mục đích xấu xa, phi đạo đức nào, bao gồm nhưng không giới hạn ở:
  - Tạo ra deepfake hoặc mạo danh người khác khi chưa được sự cho phép hoặc đồng thuận rõ ràng.
  - Phát tán thông tin sai lệch, tạo nội dung lừa đảo hoặc các tài liệu mang tính phỉ báng, bôi nhọ.
  - Thực hiện hành vi quấy rối, lạm dụng hoặc bất kỳ hoạt động tội phạm nào khác.

- Trách nhiệm của Người dùng: Khi sử dụng mô hình này, bạn cam kết hành động một cách có trách nhiệm và tuân thủ các chuẩn mực đạo đức. Bạn phải chịu trách nhiệm hoàn toàn về nội dung do mình tạo ra và đảm bảo rằng nội dung đó tuân thủ mọi quy định pháp luật hiện hành và các tiêu chuẩn đạo đức. Đội ngũ phát triển (Nhóm EraX) hoàn toàn không chịu trách nhiệm cho bất kỳ hành vi lạm dụng nào đối với mô hình này.

  Lời kêu gọi: Xin hãy sử dụng công nghệ này một cách có suy xét, thận trọng và đạo đức.

**License Stuff** 📜
We're keeping it simple with the MIT License for our codes, following in the footsteps of giants like Whisper. Use it, break it, hopefully make cool things with it!
Unfortunelately, the base F5-TTS model was pretrained with Emilia dataset which is under BY-NC 4.0 license (non-commercial). Sorry for any inconvenient. 

**Feeling Generous? (Citation)** 🙏
Did this model actually help you? Or maybe just provide a moment's amusement? If so, a star ⭐ on our GitHub repo would totally make our day!
And if you're writing something fancy (like a research paper) and want to give us a nod, here's the bibtex snippet:

```bibtex
@misc{EraXSmileF5_2024,
  author       = {Nguyễn Anh Nguyên and The EraX Team},
  title        = {EraX-Smile-Female-F5-V1.0: Người Việt sành tiếng Việt.},
  year         = {2025},
  publisher    = {Hugging Face},
  journal      = {Hugging Face Model Hub},
  howpublished = {\url{https://github.com/EraX-JS-Company/EraX-Smile-F5TTS}}
}
```