File size: 465 Bytes
8c1ab9c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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 ?"
},
}) |