A local web application for Vietnamese text-to-speech, reference-based voice cloning, multi-speaker generation, and voice-training dataset preparation.
The application can run with Docker or directly in Python. Docker is recommended because it packages FFmpeg, Faster-Whisper, and the required runtime dependencies.
uv.Build and start the application:
docker compose -f docker/docker-compose.web.yml up --build -d
Open the web interface:
http://127.0.0.1:7860
Follow the logs:
docker compose -f docker/docker-compose.web.yml logs -f web
Stop the application:
docker compose -f docker/docker-compose.web.yml down
The Docker image includes:
Models downloaded from Hugging Face are stored in a Docker volume and remain available across container restarts.
Install uv on Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Install the CPU dependencies:
uv sync
Install the optional transcription dependencies:
uv sync --extra asr
Start the web interface:
uv run python -m apps.gradio_main
For an NVIDIA GPU environment:
uv sync --group gpu
uv run python -m apps.gradio_main
The initial model download may take several minutes depending on the network connection.
The reference recording should contain no background music, minimal reverberation, and a consistent speaking volume. Voice cloning does not retrain the model; the recording is used only as a reference during generation.
Only clone a voice when you have the speaker's permission or otherwise have the legal right to use it.
Open the Voice Training tab:
3 seconds.15 seconds.600 ms.The generated clips are added automatically to the Training WAV files list.
Supported formats:
WAV, MP3, FLAC, M4A, OGG, AAC, MP4, MOV, MKV, WEBM
Silero VAD detects speech regions and prefers natural silence boundaries. Continuous speech longer than the configured maximum duration is divided into balanced clips.
After uploading WAV files or splitting a long recording:
Available Whisper models:
| Model | Characteristics |
|---|---|
tiny | Fastest, lower transcription accuracy |
base | Lightweight and suitable for quick tests |
small | Recommended balance of speed and accuracy |
medium | Higher accuracy with greater CPU and memory usage |
Faster-Whisper downloads the selected model on first use and stores it in the model cache.
The dataset is saved with the following structure:
finetune/dataset/
|-- metadata.csv
`-- raw_audio/
|-- audio_001.wav
`-- audio_002.wav
The metadata.csv format is:
audio_001.wav|The exact transcript for the first recording.
audio_002.wav|The exact transcript for the second recording.
Docker bind-mounts the dataset directory directly into the container:
C:\code\tts-app\finetune\dataset
-> /app/finetune/dataset
The dataset remains on the host after the container is removed.
Each WAV file should:
Suggested dataset sizes:
| Purpose | Total duration |
|---|---|
| Pipeline validation | 15-30 minutes |
| Experimental fine-tuning | Approximately 1 hour |
| More stable fine-tuning | 2-4 hours |
A few recordings are not enough to fine-tune a stable voice. Use reference-based voice cloning when only a small amount of audio is available.
The web interface prepares the dataset but does not run training. Fine-tuning requires a GPU environment and the scripts under finetune/.
Install the GPU dependencies:
uv sync --group gpu
Filter invalid or unsuitable samples:
uv run python finetune/data_scripts/filter_data.py
Encode the audio samples:
uv run python finetune/data_scripts/encode_data.py
Start training:
uv run python finetune/train.py
Training output is written under:
finetune/output/<run-name>
An NVIDIA GPU with at least 12 GB of VRAM is recommended. Review the training configuration before starting:
finetune/configs/lora_config.py
| Data | Location |
|---|---|
| Training dataset | finetune/dataset |
| Fine-tuning output | finetune/output |
| Generated Docker output | Docker volume managed by Compose |
| Docker model cache | Docker volume managed by Compose |
Do not commit private recordings, datasets, or model files without verifying that you have the necessary data rights.
Run the container on another host port:
$env:PORT=7861
docker compose -f docker/docker-compose.web.yml up -d
Open http://127.0.0.1:7861.
docker/Dockerfile.web.docker compose -f docker/docker-compose.web.yml logs -f web.Review the web service in docker/docker-compose.web.yml. The bind mount destination must be:
/app/finetune/dataset
apps/ Gradio interface and application workflows
src/ Text-to-speech backend
docker/ Dockerfiles and Compose configuration
finetune/ Dataset preparation and fine-tuning scripts
tests/ Automated tests
examples/ Example code and audio files
config.yaml Model and text chunking configuration
pyproject.toml Dependencies and application entry points
See LICENSE.
5 commits
Python
83.8%
HTML
8.6%
Jupyter Notebook
5.1%
Makefile
1.5%
A local web application for Vietnamese text-to-speech, reference-based voice cloning, multi-speaker generation, and voice-training dataset preparation.
The application can run with Docker or directly in Python. Docker is recommended because it packages FFmpeg, Faster-Whisper, and the required runtime dependencies.
uv.Build and start the application:
docker compose -f docker/docker-compose.web.yml up --build -d
Open the web interface:
http://127.0.0.1:7860
Follow the logs:
docker compose -f docker/docker-compose.web.yml logs -f web
Stop the application:
docker compose -f docker/docker-compose.web.yml down
The Docker image includes:
Models downloaded from Hugging Face are stored in a Docker volume and remain available across container restarts.
Install uv on Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Install the CPU dependencies:
uv sync
Install the optional transcription dependencies:
uv sync --extra asr
Start the web interface:
uv run python -m apps.gradio_main
For an NVIDIA GPU environment:
uv sync --group gpu
uv run python -m apps.gradio_main
The initial model download may take several minutes depending on the network connection.
The reference recording should contain no background music, minimal reverberation, and a consistent speaking volume. Voice cloning does not retrain the model; the recording is used only as a reference during generation.
Only clone a voice when you have the speaker's permission or otherwise have the legal right to use it.
Open the Voice Training tab:
3 seconds.15 seconds.600 ms.The generated clips are added automatically to the Training WAV files list.
Supported formats:
WAV, MP3, FLAC, M4A, OGG, AAC, MP4, MOV, MKV, WEBM
Silero VAD detects speech regions and prefers natural silence boundaries. Continuous speech longer than the configured maximum duration is divided into balanced clips.
After uploading WAV files or splitting a long recording:
Available Whisper models:
| Model | Characteristics |
|---|---|
tiny | Fastest, lower transcription accuracy |
base | Lightweight and suitable for quick tests |
small | Recommended balance of speed and accuracy |
medium | Higher accuracy with greater CPU and memory usage |
Faster-Whisper downloads the selected model on first use and stores it in the model cache.
The dataset is saved with the following structure:
finetune/dataset/
|-- metadata.csv
`-- raw_audio/
|-- audio_001.wav
`-- audio_002.wav
The metadata.csv format is:
audio_001.wav|The exact transcript for the first recording.
audio_002.wav|The exact transcript for the second recording.
Docker bind-mounts the dataset directory directly into the container:
C:\code\tts-app\finetune\dataset
-> /app/finetune/dataset
The dataset remains on the host after the container is removed.
Each WAV file should:
Suggested dataset sizes:
| Purpose | Total duration |
|---|---|
| Pipeline validation | 15-30 minutes |
| Experimental fine-tuning | Approximately 1 hour |
| More stable fine-tuning | 2-4 hours |
A few recordings are not enough to fine-tune a stable voice. Use reference-based voice cloning when only a small amount of audio is available.
The web interface prepares the dataset but does not run training. Fine-tuning requires a GPU environment and the scripts under finetune/.
Install the GPU dependencies:
uv sync --group gpu
Filter invalid or unsuitable samples:
uv run python finetune/data_scripts/filter_data.py
Encode the audio samples:
uv run python finetune/data_scripts/encode_data.py
Start training:
uv run python finetune/train.py
Training output is written under:
finetune/output/<run-name>
An NVIDIA GPU with at least 12 GB of VRAM is recommended. Review the training configuration before starting:
finetune/configs/lora_config.py
| Data | Location |
|---|---|
| Training dataset | finetune/dataset |
| Fine-tuning output | finetune/output |
| Generated Docker output | Docker volume managed by Compose |
| Docker model cache | Docker volume managed by Compose |
Do not commit private recordings, datasets, or model files without verifying that you have the necessary data rights.
Run the container on another host port:
$env:PORT=7861
docker compose -f docker/docker-compose.web.yml up -d
Open http://127.0.0.1:7861.
docker/Dockerfile.web.docker compose -f docker/docker-compose.web.yml logs -f web.Review the web service in docker/docker-compose.web.yml. The bind mount destination must be:
/app/finetune/dataset
apps/ Gradio interface and application workflows
src/ Text-to-speech backend
docker/ Dockerfiles and Compose configuration
finetune/ Dataset preparation and fine-tuning scripts
tests/ Automated tests
examples/ Example code and audio files
config.yaml Model and text chunking configuration
pyproject.toml Dependencies and application entry points
See LICENSE.
5 commits
Python
83.8%
HTML
8.6%
Jupyter Notebook
5.1%
Makefile
1.5%