Faster Whisper Small
Faster Whisper Small is a lightweight, high-performance, open-source model for speech recognition.
Deploy Faster Whisper Small behind an API endpoint in seconds.
Deploy modelExample usage
This implementation of Whisper Small uses Faster Whisper, which is up to 4x faster than the original implementation while achieving the same accuracy and using less memory.
The model accepts a single URL to an audio file, such as a .mp3
or .wav
. The audio file should contain clearly audible speech. This example transcribes a ten-second snippet of a recitation of the Gettysburg address.
The JSON output includes the auto-detected language, transcription segments with timestamps, and the complete transcribed text.
1import requests
2import os
3
4# Replace the empty string with your model id below
5model_id = ""
6
7# We recommend storing your API key as an environment variable
8baseten_api_key = os.environ["BASETEN_API_KEY"]
9
10data = {
11 "url": "https://cdn.baseten.co/docs/production/Gettysburg.mp3"
12}
13
14# Call model endpoint
15res = requests.post(
16 f"https://model-{model_id}.api.baseten.co/production/predict",
17 headers={"Authorization": f"Api-Key {baseten_api_key}"},
18 json=data
19)
20
21# Print the output of the model
22print(res.json())
1{
2 "language": "en",
3 "language_probability": 0.99072265625,
4 "duration": 11.52,
5 "segments": [
6 {
7 "text": "Four score and seven years ago, our fathers brought forth upon this continent a new nation",
8 "start": 0,
9 "end": 6.52
10 },
11 {
12 "text": "conceived in liberty and dedicated to the proposition that all men are created equal.",
13 "start": 6.52,
14 "end": 11
15 }
16 ]
17}