demo_app / app.py
project21's picture
Update app.py
811c528 verified
raw
history blame contribute delete
338 Bytes
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)