WenMinaaa commited on
Commit
fbd6667
·
verified ·
1 Parent(s): 84fac71

Create LLAMA.py

Browse files
Files changed (1) hide show
  1. LLAMA.py +19 -0
LLAMA.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import requests
2
+ import os
3
+
4
+ API_URL = "https://api-inference.huggingface.co/models/meta-llama/LlamaGuard-7b"
5
+ access_token = os.environ["HF_ACCESS_TOKEN"]
6
+ headers = {"Authorization": f"Bearer {access_token}"}
7
+
8
+
9
+
10
+ def query(payload):
11
+ response = requests.post(API_URL, headers=headers, json=payload)
12
+ return response.json()
13
+
14
+
15
+ output = query({
16
+ "inputs": "Can you please let us know more details about your ",
17
+ })
18
+
19
+ print(output)