File size: 553 Bytes
411f5ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
---
license: afl-3.0
datasets:
- fka/awesome-chatgpt-prompts
language:
- en
- fr
- es
metrics:
- accuracy
- bleu
- character
pipeline_tag: conversational
tags:
- climate
---
import requests

API_URL = "https://api-inference.huggingface.co/models/openai/whisper-large-v3"
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")