Views
No views yet
1# Example with raw audio bytes
2import requests
3
4API_URL = "https://api-inference.huggingface.co/models/YOUR_USERNAME/clip-worthy-detector"
5headers = {"Authorization": f"Bearer {API_TOKEN}"}
6
7def query(filename):
8 with open(filename, "rb") as f:
9 data = f.read()
10 response = requests.post(API_URL, headers=headers, data=data)
11 return response.json()
12
13output = query("audio_sample.wav")1{
2 "prediction": 1,
3 "label": "clip-worthy",
4 "confidence": 0.92,
5 "probabilities": {
6 "not-clip-worthy": 0.08,
7 "clip-worthy": 0.92
8 }
9}