Signed-off-by: Yueqian Lin <linyueqian@outlook.com> Co-authored-by: SYLAR <125541396+lishunyang12@users.noreply.github.com>
44 lines
1.1 KiB
Markdown
44 lines
1.1 KiB
Markdown
# VoxCPM2 Online Serving
|
|
|
|
Serve VoxCPM2 TTS via the OpenAI-compatible `/v1/audio/speech` endpoint.
|
|
|
|
## Start the Server
|
|
|
|
```bash
|
|
vllm serve openbmb/VoxCPM2 --omni --host 0.0.0.0 --port 8000
|
|
```
|
|
|
|
The deploy config is auto-loaded from `vllm_omni/deploy/voxcpm2.yaml`. Pass
|
|
`--deploy-config <path>` to override, or `--stage-N-<field> <value>` (e.g.
|
|
`--stage-0-max-num-seqs 8`) for per-stage runtime overrides.
|
|
|
|
## Zero-shot Synthesis
|
|
|
|
```bash
|
|
python openai_speech_client.py --text "Hello, this is VoxCPM2."
|
|
```
|
|
|
|
Or with curl:
|
|
|
|
```bash
|
|
curl -X POST http://localhost:8000/v1/audio/speech \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"model": "voxcpm2", "input": "Hello, this is VoxCPM2.", "voice": "default"}' \
|
|
--output output.wav
|
|
```
|
|
|
|
## Voice Cloning
|
|
|
|
Clone a speaker's voice using a reference audio file:
|
|
|
|
```bash
|
|
python openai_speech_client.py \
|
|
--text "This should sound like the reference speaker." \
|
|
--ref-audio /path/to/reference.wav
|
|
```
|
|
|
|
The `--ref-audio` parameter accepts:
|
|
- Local file path (auto-encoded to base64)
|
|
- URL (`https://...`)
|
|
- Base64 data URI (`data:audio/wav;base64,...`)
|