Snippets Collections
import json
import requests
API_URL = "https://api-inference.huggingface.co/models/gpt2"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
def query(payload):
    data = json.dumps(payload)
    response = requests.request("POST", API_URL, headers=headers, data=data)
    return json.loads(response.content.decode("utf-8"))
data = query("Can you please let us know more details about your ")
ENDPOINT = https://api-inference.huggingface.co/models/<MODEL_ID>
star

Mon Jul 24 2023 02:28:33 GMT+0000 (Coordinated Universal Time) https://huggingface.co/docs/api-inference/quicktour

#huggingface #hf #api
star

Mon Jul 24 2023 02:26:25 GMT+0000 (Coordinated Universal Time) https://huggingface.co/docs/api-inference/quicktour

#huggingface #hf

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension