File size: 364 Bytes
6b694b5 5b29361 6b694b5 34f84c7 1620753 34f84c7 1620753 34f84c7 |
1 2 3 4 5 6 7 8 9 10 11 12 |
import requests
API_URL = "https://api-inference.huggingface.co/models/openai/whisper-large-v3-turbo"
headers = {"Authorization": "Bearer hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
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.flac") |