File size: 520 Bytes
a12ee00
 
 
 
 
 
 
 
 
 
 
 
 
 
aee088c
a12ee00
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import requests

API_URL = "https://<use your own Inference Endpoint here>.endpoints.huggingface.cloud"
headers = {
	"Accept" : "application/json",
	"Authorization": "Bearer hf_XXXXX", # <- use your own Hugging Face token with Inference Endpoints access
	"Content-Type": "application/json" 
}

def query(payload):
	response = requests.post(API_URL, headers=headers, json=payload)
	return response.json()

output = query({
	"inputs": "underwater footage, beautiful clownfishes swimming around coral",
	"parameters": {}
})