import requests

API_URL = "https://api-inference.huggingface.co/models/gpt2" headers = {"Authorization": "Bearer YOUR_FREE_TOKEN"} # Replace with your token

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

output = query({"inputs": "The future of AI is", "max_length": 30}) print(output)

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support