firstmodel / app.py
kushwap1
initia
bc22b76
Raw History Blame Contribute Delete
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)