Downloads · 30 days
0
Kingdogodogoo1/GPT-2
GPT-2 is a machine learning model from Kingdogodogoo1. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Jun 10, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 80%
From the Hugging Face model README
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)