File size: 338 Bytes
811c528 8625f8f 811c528 8625f8f 811c528 8625f8f 811c528 |
1 2 3 4 5 6 7 8 9 10 11 12 |
import requests
API_URL = "https://api-inference.huggingface.co/models/your-username/your-model-name"
headers = {"Authorization": "Bearer YOUR_HUGGINGFACE_TOKEN"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
data = query({"inputs": "your input text"})
print(data)
|