Automatic Speech Recognition
faster-whisper-large-v3-ca-3catparla
GPU: T4
How to use it: Notebook for using Faster Whisper
STT Ca Citrinet 512
GPU: T4
whisper-large-v3-ca-3catparla
GPU: T4
ASR APIs
How to use it: Notebook for using whisper
whisper-large-v3-ca-3catparla endpoint
import requests
API_URL = "https://ddb95svxi9vs16zy.us-east-1.aws.endpoints.huggingface.cloud"
headers = {
"Accept": "application/json",
"Authorization": "Bearer <hf_token>",
"Content-Type": "audio/wav",
}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
return response.json()
output = query("sample1.wav")
faster-whisper endpoint
Python
import requests
API_URL = "https://l9w4uzm374uyn9xk.us-east-1.aws.endpoints.huggingface.cloud"
headers = {
"Accept": "application/json",
"Authorization": "Bearer HF_token",
"Content-Type": "audio/wav",
}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
return response.json()
output = query("sample1.wav")
Curl
curl "https://l9w4uzm374uyn9xk.us-east-1.aws.endpoints.huggingface.cloud/" \
-X POST \
--data-binary '@sample1.flac' \
-H "Accept: application/json" \
-H "Authorization: Bearer hf_XXXXX" \
-H "Content-Type: audio/flac" \// Some code
Citrinet endpoint
Python
import requests
API_URL = "https://h3xisjmpemyv68l1.us-east-1.aws.endpoints.huggingface.cloud/"
headers = {
"Accept" : "application/json",
"Authorization": "Bearer hf_xxxx",
"Content-Type": "audio/wav"
}
def query(filename):
with open(filename, "rb") as f:
data = f.read()
response = requests.post(API_URL, headers=headers, data=data)
return response.json()
output = query("sample.wav")
print(output)
Possible issues with endpoints:
HTTP/1.1 401 Unauthorized: The Hugging Face token was not specified, or the token is invalid. Copy the token code and replace it where <hf_token> in the headers
HTTP/1.1 503: The service is unavailable. Occurs when the endpoint is initializing, as it is not active all the time. Try the same request again.
Last updated