Downloads · 30 days
0
tonchikkk/n
n is a machine learning model from tonchikkk. 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 apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Jul 5, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 76%
From the Hugging Face model README
import requests
def get_huggingface_response(prompt): headers = {"Authorization": "Bearer YOUR_HUGGING_FACE_API_KEY"} payload = {"inputs": prompt} response = requests.post("https://api-inference.huggingface.co/models/gpt2", headers=headers, json=payload) return response.json()[0]['generated_text']
prompt = "Привет, мир!" response = get_huggingface_response(prompt) print(response)