Downloads · 30 days
0
vfxinova/voxcpm2-tts-endpoint
voxcpm2-tts-endpoint is a machine learning model from vfxinova. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Deploy do openbmb/VoxCPM2 (TTS) como endpoint dedicado no HF, com clonagem de voz e voice design.
Downloads · 30 days
0
Access
Public
Updated Jun 17, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.py4.8 KB · 52%
From the Hugging Face model README
Deploy do openbmb/VoxCPM2 (TTS) como endpoint dedicado no HF, com clonagem de voz e voice design.
handler.py — custom handler (carrega VoxCPM2, gera áudio, retorna WAV em base64).requirements.txt — dependências (voxcpm, soundfile, librosa).test_client.py — cliente de teste.Crie um repo Model (não Dataset/Space), ex.: seu-usuario/voxcpm2-tts-endpoint.
Não precisa subir os pesos — o handler baixa o VoxCPM2 do Hub no startup.
Suba handler.py e requirements.txt na raiz:
pip install -U huggingface_hub
huggingface-cli login
huggingface-cli upload seu-usuario/voxcpm2-tts-endpoint ./handler.py handler.py
huggingface-cli upload seu-usuario/voxcpm2-tts-endpoint ./requirements.txt requirements.txt
(ou pela web: "Add file" → upload os dois arquivos)
Em https://endpoints.huggingface.co/ → New endpoint:
seu-usuario/voxcpm2-tts-endpointhandler.py automaticamente (custom handler).export HF_ENDPOINT_URL="https://xxxxx.endpoints.huggingface.cloud"
export HF_TOKEN="hf_..."
python test_client.py "Que noticia maravilhosa, conseguimos!" "energetic young Brazilian woman"
# -> out.wav
Request (POST, JSON):
{
"inputs": "Texto em pt-BR.",
"parameters": {
"voice_instruction": "energetic young Brazilian woman",
"cfg_value": 2.0,
"inference_timesteps": 10,
"normalize": false,
"reference_audio_b64": "<wav base64 — opcional, p/ clonar voz>"
}
}
Response:
{ "sample_rate": 48000, "format": "wav", "duration_sec": 5.1, "audio_b64": "<wav base64>" }
voice_instruction (descrição da voz/emoção, melhor em inglês).reference_audio_b64 (um wav curto) — clona o timbre e aplica o estilo do voice_instruction.torchcodec (dependência do voxcpm) pode falhar ao carregar no container, mas o VoxCPM usa librosa pra ler a referência — funciona mesmo assim.