Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,9 +9,10 @@ API_URL = "https://api-inference.huggingface.co/models/ibrahim313/my-imdb-sentim
|
|
| 9 |
|
| 10 |
#HF_TOKEN
|
| 11 |
# Auth headers if private model
|
| 12 |
-
headers = {}
|
| 13 |
-
if "hfsecret" in st.secrets:
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
def query(payload):
|
| 17 |
response = requests.post(API_URL, headers="", json=payload)
|
|
|
|
| 9 |
|
| 10 |
#HF_TOKEN
|
| 11 |
# Auth headers if private model
|
| 12 |
+
#headers = {}
|
| 13 |
+
#if "hfsecret" in st.secrets:
|
| 14 |
+
print(f"token : {st.secrets['hfsecret']}")
|
| 15 |
+
headers = {"Authorization": f"Bearer {st.secrets['hfsecret']}"}
|
| 16 |
|
| 17 |
def query(payload):
|
| 18 |
response = requests.post(API_URL, headers="", json=payload)
|