Spaces:
Runtime error
Runtime error
Commit ·
02a17c2
1
Parent(s): d108f45
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,9 +13,9 @@ token = os.environ['HF_TOKEN']
|
|
| 13 |
# token = os.environ.get("HF_TOKEN", "")
|
| 14 |
# print(token)
|
| 15 |
API_URL = "https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic"
|
| 16 |
-
|
| 17 |
# token =
|
| 18 |
-
headers = {"Authorization":
|
| 19 |
|
| 20 |
def query(payload):
|
| 21 |
response = requests.post(API_URL, headers=headers, json=payload)
|
|
|
|
| 13 |
# token = os.environ.get("HF_TOKEN", "")
|
| 14 |
# print(token)
|
| 15 |
API_URL = "https://api-inference.huggingface.co/models/playgroundai/playground-v2-1024px-aesthetic"
|
| 16 |
+
bearer_token = "Bearer " + str(token)
|
| 17 |
# token =
|
| 18 |
+
headers = {"Authorization": bearer_token}
|
| 19 |
|
| 20 |
def query(payload):
|
| 21 |
response = requests.post(API_URL, headers=headers, json=payload)
|