ysharma HF staff commited on
Commit
d045ffb
·
1 Parent(s): ebd5d39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,7 +5,8 @@ import requests
5
 
6
 
7
  HF_TOKEN = os.getenv('HF_TOKEN')
8
- HEADERS = {"Authorization": HF_TOKEN}
 
9
  zephyr_7b_beta = os.getenv('zephyr_7b_beta')
10
  zephyr_7b_alpha = os.getenv('zephyr_7b_alpha')
11
 
@@ -35,7 +36,7 @@ def post_request_alpha(payload):
35
  """
36
  Sends a POST request to the predefined Zephyr-7b-Alpha URL and returns the JSON response.
37
  """
38
- response = requests.post(zephyr_7b_beta, headers=HEADERS, json=payload)
39
  response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
40
  return response.json()
41
 
 
5
 
6
 
7
  HF_TOKEN = os.getenv('HF_TOKEN')
8
+ HEADERS = {"Authorization": f"Bearer {HF_TOKEN}"}
9
+
10
  zephyr_7b_beta = os.getenv('zephyr_7b_beta')
11
  zephyr_7b_alpha = os.getenv('zephyr_7b_alpha')
12
 
 
36
  """
37
  Sends a POST request to the predefined Zephyr-7b-Alpha URL and returns the JSON response.
38
  """
39
+ response = requests.post(zephyr_7b_alpha, headers=HEADERS, json=payload)
40
  response.raise_for_status() # Will raise an HTTPError if the HTTP request returned an unsuccessful status code
41
  return response.json()
42