import requests | |
import os | |
API_URL = "https://api-inference.huggingface.co/models/meta-llama/LlamaGuard-7b" | |
access_token = os.environ["ACCESS_TOKEN"] | |
headers = {"Authorization": f"Bearer {access_token}"} | |
def query(payload): | |
response = requests.post(API_URL, headers=headers, json=payload) | |
return response.json() | |
output = query({ | |
"inputs": "Can you please let us know more details about your ", | |
}) | |
print(output) |