ppsingh commited on
Commit
eb04349
·
verified ·
1 Parent(s): ead9aa7

Update auditqa/reader.py

Browse files
Files changed (1) hide show
  1. auditqa/reader.py +20 -0
auditqa/reader.py CHANGED
@@ -21,6 +21,26 @@ def nvidia_client():
21
 
22
  return client
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  def dedicated_endpoint():
25
  """ returns the dedicated server endpoint"""
26
 
 
21
 
22
  return client
23
 
24
+
25
+ def serverless_api():
26
+ try:
27
+ HF_token = os.environ["LLAMA_3_1"]
28
+ if not HF_token:
29
+ raise ValueError("LLAMA_3_1 environment variable is empty")
30
+
31
+ model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
32
+
33
+ client = InferenceClient(
34
+ model=model_id,
35
+ api_key=HF_token,
36
+ )
37
+
38
+ return client
39
+
40
+ except Exception as e:
41
+ raise
42
+
43
+
44
  def dedicated_endpoint():
45
  """ returns the dedicated server endpoint"""
46