File size: 549 Bytes
3054a70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33b2a07
3054a70
 
 
 
 
 
 
 
33b2a07
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/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)