A newer version of the Gradio SDK is available: 6.22.0
metadata
title: Tool Generate Text2Speech
emoji: π£οΈ
colorFrom: blue
colorTo: purple
sdk: gradio
app_file: app.py
pinned: false
license: apache-2.0
TTS Dataset Generator (VoxCPM2)
Batch text-to-speech tool for preparing paired text/audio datasets to train
ASR and TTS models β built on openbmb/VoxCPM2.
What it does
- Upload a JSON file shaped like:
(up to 100 items per batch)[ {"id": 1, "text": "αα½ααααΈ! ααΎαααααααα’ααααα»ααααααΆαααΆαα?"}, {"id": 2, "text": "..."} ] - Optionally describe a voice (e.g.
a calm young woman, clear and steady voice) β VoxCPM2's Voice Design applies it consistently across every item. - Click Generate batch. Progress and per-item status show live in the table.
- Download the resulting
.zip:tts_dataset.zip βββ audio/ β βββ 1.wav β βββ 2.wav β βββ ... βββ metadata.csv # id, text, filename, status βββ metadata.json
Deploying this Space
This runs as a standard Gradio SDK Space (not Static / gradio-lite) because VoxCPM2 is a 2B-parameter PyTorch model β it needs real Python + (ideally) GPU execution, which a browser-only static Space cannot provide.
Push these three files (app.py, requirements.txt, README.md) to the Space repo:
git clone https://huggingface.co/spaces/phonsobon/Tool_Generate_Text2Speech
cd Tool_Generate_Text2Speech
cp /path/to/app.py /path/to/requirements.txt /path/to/README.md .
git add .
git commit -m "Batch TTS dataset generator (VoxCPM2)"
git push
Hardware notes
- Running on free CPU basic: generation is slow (roughly tens of seconds per sentence for a 2B-param model). Test with the "Limit" field set low (e.g. 5) before running a full batch of 100.
- If you later upgrade to HF PRO you can switch this Space to ZeroGPU
hardware in the Space settings for a large speed-up β no code changes needed,
just add a
@spaces.GPUdecorator around the generation call. - Khmer is one of VoxCPM2's 30 officially supported languages.