test / ap.py
Dagfinn1962's picture
Update ap.py
82faa1d
raw
history blame contribute delete
391 Bytes
import requests
API_URL = "https://api-inference.huggingface.co/models/Sanyam0605/whisper-large-v2-hi"
headers = {"Authorization": "Bearer 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"}
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")