Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input/output refactor for whisper v3 #145

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions whisper/whisper-v3-truss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,47 @@ curl -X POST "https://model-{MODEL_ID}.api.baseten.co/development/predict" \
-d '{"url": "https://cdn.baseten.co/docs/production/Gettysburg.mp3"}'
```

Here is how to invoke the model in Python:

```python
import requests
import os

# Replace the empty string with your model id below
model_id = ""
baseten_api_key = os.environ["BASETEN_API_KEY"]

data = {
"url": "https://cdn.baseten.co/docs/production/Gettysburg.mp3"
}

# Call the model endpoint
res = requests.post(
f"https://model-{model_id}.api.baseten.co/production/predict",
headers={"Authorization": f"Api-Key {baseten_api_key}"},
json=data
)

# Get the response from the model
res = res.json()
print(res)
```

Here is the output of the model:
```json
{
"language": "english",
"segments": [
{
"start": 0,
"end": 11.52,
"text": "Four score and seven years ago our fathers brought forth upon this continent a new nation conceived in liberty and dedicated to the proposition that all men are created equal."
}
],
"text": "Four score and seven years ago our fathers brought forth upon this continent a new nation conceived in liberty and dedicated to the proposition that all men are created equal."
}
```

### Whisper API documentation

#### Input
Expand Down
Loading