Skip to content

Instantly share code, notes, and snippets.

@jondurbin
Created March 18, 2025 09:20
Show Gist options
  • Save jondurbin/4d3ef8c41e8c496c1830825f01704c69 to your computer and use it in GitHub Desktop.
Save jondurbin/4d3ef8c41e8c496c1830825f01704c69 to your computer and use it in GitHub Desktop.
Example inference with csm-1b on chutes
import os
import requests
import base64
audio = base64.b64encode(open("test.wav", "rb").read()).decode()
result = requests.post(
"https://chutes-csm-1b.chutes.ai/speak",
json={
"speaker": 1,
"context": [
{
"speaker": 0,
"text": "hello, how are you today? anything on your mind?",
"audio_b64": audio
}
],
"text": "Oh I'm fine, thank you, nothing on my mind in particular, how are you?"
},
headers={
"Authorization": os.environ["CHUTES_API_KEY"],
},
)
with open("new.wav", "wb") as outfile:
outfile.write(result.content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment