Llama / InferenceAPI
arao02's picture
Create InferenceAPI
8c1ab9c
raw
history blame contribute delete
No virus
465 Bytes
import requests
API_URL = "https://api-inference.huggingface.co/models/microsoft/DialoGPT-medium"
headers = {"Authorization": "Bearer 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"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
output = query({
"inputs": {
"past_user_inputs": ["Which movie is the best ?"],
"generated_responses": ["It's Die Hard for sure."],
"text": "Can you explain why ?"
},
})