Downloads · 30 days
0
tejaskale/vibevoice-hf-endpoint
vibevoice-hf-endpoint is a machine learning model from tejaskale. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Optimized for 10-30 minute audio generation with modern Python tooling.
Downloads · 30 days
0
Access
Public
Updated Sep 1, 2025
Repo size
10.6 MB
Likes
0
Public
Click a slice to open those files.
.wav10.6 MB · 97%
From the Hugging Face model README
Optimized for 10-30 minute audio generation with modern Python tooling.
handler.py - Production handler for HuggingFace Inference Endpoints (requires NVIDIA GPU + Flash Attention 2)handler_dev.py - Development handler for Mac/local testing (CPU/MPS compatible)pyproject.toml - Modern dependency management for developmentrequirements.txt - Production dependencies for HuggingFace deployment# Install development dependencies (Mac-compatible, no Flash Attention)
uv sync
# Test API structure locally
python handler_dev.py
# Or test with custom input
python -c "
from handler_dev import DevelopmentVibeVoiceHandler
handler = DevelopmentVibeVoiceHandler()
result = handler({'inputs': 'Speaker 1: Hello world!'})
print(f'Success: {result[\"duration\"]}s mock audio generated')
"
handler.py + requirements.txt to HuggingFace Inference Endpoints# Clone/create project
mkdir vibevoice-longform-endpoint
cd vibevoice-longform-endpoint
# Install uv if needed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Set up development environment
uv venv
source .venv/bin/activate
uv sync
# Test development handler
python handler_dev.py
# Install dependencies
uv sync
# Add new dependency
uv add package-name
# Add development dependency
uv add --dev package-name
# Run code formatting
uv run black .
uv run isort .
uv run ruff check .
# Test locally
python handler_dev.py
Upload to HuggingFace Hub:
git init
git add handler.py requirements.txt README.md
git commit -m "VibeVoice production handler"
git remote add origin https://huggingface.co/YOUR_USERNAME/vibevoice-longform
git push -u origin main
Create Inference Endpoint:
Test Production Endpoint:
import requests
response = requests.post(
"https://YOUR_ENDPOINT.endpoints.huggingface.cloud",
headers={"Authorization": "Bearer YOUR_TOKEN"},
json={
"inputs": "Speaker 1: Hello! Speaker 2: Hi there!",
"parameters": {"cfg_scale": 1.2, "ddmp_steps": 6}
}
)
cfg_scale (float, 1.0-1.5): Voice matching strength
1.0-1.1: Faster, more natural speech1.2-1.3: Balanced (recommended)1.4-1.5: Better voice cloning, slowerddmp_steps (int, 4-12): Quality vs speed trade-off
4-5: Fastest generation6-8: Balanced (recommended for long content)10-12: Highest quality, slowermax_new_tokens (int): Maximum generation length
4096: ~5-10 minutes8192: ~10-20 minutes (default)12288+: 20+ minutes{
"inputs": "Speaker 1: Hello! Speaker 2: Hi there!",
"parameters": {
"voice_samples": ["base64_audio_1", "base64_audio_2"],
"speaker_names": ["Alice", "Bob"],
"cfg_scale": 1.2,
"ddmp_steps": 6,
"output_format": "wav"
}
}
| Content Length | Generation Time | Memory Usage | RTF |
|---|---|---|---|
| 10 minutes | 60-120s | 15-18GB | 0.1-0.2x |
| 20 minutes | 120-240s | 18-22GB | 0.1-0.2x |
| 30 minutes | 180-360s | 20-24GB | 0.1-0.2x |
RTF = Real-Time Factor (generation_time / audio_duration)
Problem: flash-attn build fails on Mac
Solution: Use handler_dev.py for local development - it uses SDPA instead of Flash Attention
Problem: VibeVoice model not available
Solution: handler_dev.py includes mock mode for API structure testing
Problem: Flash Attention 2 not available Solution: Ensure NVIDIA GPU with CUDA 11.6+ and compute capability 7.5+
Problem: Out of memory Solution: Use A100 (40GB) or reduce content length
handler_dev.py on Mac to test API logichandler.py on HuggingFace with NVIDIA GPU| Aspect | Development (handler_dev.py) | Production (handler.py) |
|---|---|---|
| Platform | Mac/CPU/MPS compatible | NVIDIA CUDA only |
| Attention | SDPA (compatible) | Flash Attention 2 (required) |
| Memory | Low requirements | 20GB+ VRAM needed |
| Purpose | API testing, logic validation | Actual audio generation |
| Output | Mock audio for testing | High-quality TTS audio |