phonsobon's picture
Upload 3 files
be6318c verified
|
Raw
History Blame Contribute Delete
2.21 kB
---
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`](https://huggingface.co/openbmb/VoxCPM2).
## What it does
1. Upload a JSON file shaped like:
```json
[
{"id": 1, "text": "αžŸαž½αžŸαŸ’αžαžΈ! αžαžΎαžαŸ’αž„αŸƒαž“αŸαŸ‡αž’αŸ’αž“αž€αžŸαž»αžαžŸαž”αŸ’αž”αžΆαž™αž‡αžΆαž‘αŸ?"},
{"id": 2, "text": "..."}
]
```
(up to 100 items per batch)
2. Optionally describe a voice (e.g. `a calm young woman, clear and steady voice`) β€”
VoxCPM2's Voice Design applies it consistently across every item.
3. Click **Generate batch**. Progress and per-item status show live in the table.
4. 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:
```bash
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.GPU` decorator around the generation call.
- Khmer is one of VoxCPM2's 30 officially supported languages.