Download app.py from Willaim/gaai: direct link, hf CLI and curl.
- Browser
- Download file 501 Bytes
-
https://huggingface.co/Willaim/gaai/resolve/main/app.py
- Command line
-
hf download hf://Willaim/gaai/app.py
-
curl -L -o app.py https://huggingface.co/Willaim/gaai/resolve/main/app.py
501 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 ?" | |
| }, | |
| }) |