basetenlabs / truss-examples

Examples of models deployable with Truss
https://trussml.com
MIT License
130 stars 37 forks source link

Added whisper model that takes base64 input. #312

Closed squidarth closed 3 months ago

squidarth commented 3 months ago

Summary

Modified whisper v3 to take base64 as input.

Testing

Deployed model, and tested with this script:

import requests
import base64

audio_base64 = base64.b64encode(open("Gettysburg.mp3", "rb").read()).decode('utf-8')

resp = requests.post(
    "https://model-{MODEL_ID}.api.baseten.co/development/predict",
    headers={"Authorization": "Api-Key $BASETEN_API_KEY"},
    json={'audio': audio_base64},
)

print(resp.content)