Download app.py from kushwap1/firstmodel: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/kushwap1/firstmodel/resolve/main/app.py
- Command line
-
hf download hf://kushwap1/firstmodel/app.py
-
curl -L -o app.py https://huggingface.co/kushwap1/firstmodel/resolve/main/app.py
381 Bytes
| import requests | |
| API_URL = "https://api-inference.huggingface.co/models/google/flan-t5-base" | |
| 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": "Translate to Spanish: My name is Arthur", | |
| }) | |
| print(output) |