hfstudio / test_chatterbox.py
GitHub Action
Sync from GitHub: b110eba71afe95ef3e43dd1d91c79c3e172e36f7
33b2a07
#!/usr/bin/env python3
from huggingface_hub import InferenceClient
# Initialize the client
client = InferenceClient(
provider="fal-ai",
)
# Test parameters (matching what our app sends)
text = "In a hole in the ground there lived a hobbit."
extra_body = {
"exaggeration": 0.25,
"temperature": 0.7,
"audio_url": "https://huggingface.co/spaces/abidlabs/hfstudio/resolve/main/frontend/static/voices/lily.mp3",
}
bytes = client.text_to_speech(
text,
model="ResembleAI/chatterbox",
extra_body=extra_body,
)
print(bytes)