Created
March 18, 2025 09:20
-
-
Save jondurbin/4d3ef8c41e8c496c1830825f01704c69 to your computer and use it in GitHub Desktop.
Example inference with csm-1b on chutes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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