Instruction-guided Vietnamese Text-to-Speech with natural language voice control
🤗 Model | 📄 Original Paper | 🔧 Upstream Repo
This is a Vietnamese adaptation of Parler-TTS, focused on instruction-guided speech generation.
You describe the voice you want in natural language, for example:
Giọng nữ trẻ miền Bắc, nói chậm rãi, giọng caoGiọng nam trưởng thành miền Nam, nói nhanh và rất toGiọng nữ miền Trung, nói chậm rãi với âm lượng nhỏ, giọng trầmand the model generates Vietnamese speech that matches the description.
This repository is intentionally kept inference-first:
api.py for CLI and Python usageapp.py for a Gradio web UIparler_tts/ for the underlying Parler-TTS model codeThe default model repository is:
| Component | Original | This Fork |
|---|---|---|
| Language | English-focused | Vietnamese |
| Text encoder | Flan-T5 family | ViT5-based Vietnamese setup |
| Main use case | General controllable TTS | Vietnamese voice design / instruction TTS |
| Repository scope | Full training + inference | Clean inference-first release |
git clone https://github.com/thangquang09/vietnamese-parlertts.git
cd vietnamese-parlertts
pip install -e .
For the Gradio app:
pip install -e .[app]
Generate speech from the default Hugging Face repo:
python api.py \
--text "Xin chào, hôm nay bạn có khoẻ không?" \
--description "Giọng nữ trẻ miền Bắc, nói chậm rãi, giọng cao" \
--output output.wav
Use a specific Hugging Face repo:
python api.py \
--text "Thời tiết hôm nay rất đẹp." \
--description "Giọng nam trung niên, nhịp nói vừa phải." \
--hf-repo thangquang09/parler-tts-vietnamese-v1-stage2
Use a local checkpoint directory:
python api.py \
--text "Xin chào" \
--description "Giọng nữ trẻ, âm lượng vừa" \
--model /path/to/local/model_dir
The model will be loaded automatically from Hugging Face or from your local checkpoint directory, depending on the arguments you pass.
from api import ParlerTTSAPI
# Load default Hugging Face repo
tts = ParlerTTSAPI(device="cuda:0")
tts.synthesize(
text="Hôm nay trời đẹp quá.",
description="Giọng nữ trẻ miền Bắc, nói chậm rãi và nhẹ nhàng.",
output_path="output.wav",
)
Load a custom source:
# Specific HF repo
tts = ParlerTTSAPI(hf_model_repo="thangquang09/parler-tts-vietnamese-v1-stage2")
# Or local checkpoint
tts = ParlerTTSAPI(model_name_or_path="/path/to/local/model_dir")
Run the web UI with the default model:
python app.py
Use a specific Hugging Face repo:
python app.py --hf_model_repo thangquang09/parler-tts-vietnamese-v1-stage2
Use a local checkpoint:
python app.py --model /path/to/local/model_dir
Then open http://localhost:7860 in your browser.
Features:
--shareThe inference entrypoints are designed to be flexible:
--model has the highest priority and can be either a local path or a repo ID--model is not provided, api.py uses --hf-repo--model is not provided, app.py uses --hf_model_repo or --hf-repothangquang09/parler-tts-vietnamese-v1-stage2This makes it easy to switch between:
├── api.py # Main inference API and CLI
├── app.py # Gradio web UI
├── parler_tts/ # Core Parler-TTS model code
├── setup.py
├── pyproject.toml
└── README.md
Default model:
This project is based on Parler-TTS:
@misc{lacombe-etal-2024-parler-tts,
author = {Yoach Lacombe and Vaibhav Srivastav and Sanchit Gandhi},
title = {Parler-TTS},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/huggingface/parler-tts}}
}
@misc{lyth2024natural,
title={Natural language guidance of high-fidelity text-to-speech with synthetic annotations},
author={Dan Lyth and Simon King},
year={2024},
eprint={2402.01912},
archivePrefix={arXiv},
primaryClass={cs.SD}
}
Licensed under Apache License 2.0.
7 commits
Instruction-guided Vietnamese Text-to-Speech with natural language voice control
🤗 Model | 📄 Original Paper | 🔧 Upstream Repo
This is a Vietnamese adaptation of Parler-TTS, focused on instruction-guided speech generation.
You describe the voice you want in natural language, for example:
Giọng nữ trẻ miền Bắc, nói chậm rãi, giọng caoGiọng nam trưởng thành miền Nam, nói nhanh và rất toGiọng nữ miền Trung, nói chậm rãi với âm lượng nhỏ, giọng trầmand the model generates Vietnamese speech that matches the description.
This repository is intentionally kept inference-first:
api.py for CLI and Python usageapp.py for a Gradio web UIparler_tts/ for the underlying Parler-TTS model codeThe default model repository is:
| Component | Original | This Fork |
|---|---|---|
| Language | English-focused | Vietnamese |
| Text encoder | Flan-T5 family | ViT5-based Vietnamese setup |
| Main use case | General controllable TTS | Vietnamese voice design / instruction TTS |
| Repository scope | Full training + inference | Clean inference-first release |
git clone https://github.com/thangquang09/vietnamese-parlertts.git
cd vietnamese-parlertts
pip install -e .
For the Gradio app:
pip install -e .[app]
Generate speech from the default Hugging Face repo:
python api.py \
--text "Xin chào, hôm nay bạn có khoẻ không?" \
--description "Giọng nữ trẻ miền Bắc, nói chậm rãi, giọng cao" \
--output output.wav
Use a specific Hugging Face repo:
python api.py \
--text "Thời tiết hôm nay rất đẹp." \
--description "Giọng nam trung niên, nhịp nói vừa phải." \
--hf-repo thangquang09/parler-tts-vietnamese-v1-stage2
Use a local checkpoint directory:
python api.py \
--text "Xin chào" \
--description "Giọng nữ trẻ, âm lượng vừa" \
--model /path/to/local/model_dir
The model will be loaded automatically from Hugging Face or from your local checkpoint directory, depending on the arguments you pass.
from api import ParlerTTSAPI
# Load default Hugging Face repo
tts = ParlerTTSAPI(device="cuda:0")
tts.synthesize(
text="Hôm nay trời đẹp quá.",
description="Giọng nữ trẻ miền Bắc, nói chậm rãi và nhẹ nhàng.",
output_path="output.wav",
)
Load a custom source:
# Specific HF repo
tts = ParlerTTSAPI(hf_model_repo="thangquang09/parler-tts-vietnamese-v1-stage2")
# Or local checkpoint
tts = ParlerTTSAPI(model_name_or_path="/path/to/local/model_dir")
Run the web UI with the default model:
python app.py
Use a specific Hugging Face repo:
python app.py --hf_model_repo thangquang09/parler-tts-vietnamese-v1-stage2
Use a local checkpoint:
python app.py --model /path/to/local/model_dir
Then open http://localhost:7860 in your browser.
Features:
--shareThe inference entrypoints are designed to be flexible:
--model has the highest priority and can be either a local path or a repo ID--model is not provided, api.py uses --hf-repo--model is not provided, app.py uses --hf_model_repo or --hf-repothangquang09/parler-tts-vietnamese-v1-stage2This makes it easy to switch between:
├── api.py # Main inference API and CLI
├── app.py # Gradio web UI
├── parler_tts/ # Core Parler-TTS model code
├── setup.py
├── pyproject.toml
└── README.md
Default model:
This project is based on Parler-TTS:
@misc{lacombe-etal-2024-parler-tts,
author = {Yoach Lacombe and Vaibhav Srivastav and Sanchit Gandhi},
title = {Parler-TTS},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/huggingface/parler-tts}}
}
@misc{lyth2024natural,
title={Natural language guidance of high-fidelity text-to-speech with synthetic annotations},
author={Dan Lyth and Simon King},
year={2024},
eprint={2402.01912},
archivePrefix={arXiv},
primaryClass={cs.SD}
}
Licensed under Apache License 2.0.
7 commits
Python
100.0%