Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,13 +7,14 @@ st.set_page_config(page_title="IMDB Sentiment Analyzer 🎬", page_icon="🎬",
|
|
| 7 |
# Hugging Face model API
|
| 8 |
API_URL = "https://api-inference.huggingface.co/models/ibrahim313/my-imdb-sentiment-analyzer"
|
| 9 |
|
|
|
|
| 10 |
# Auth headers if private model
|
| 11 |
-
headers = {}
|
| 12 |
-
if "HF_TOKEN" in st.secrets:
|
| 13 |
-
|
| 14 |
|
| 15 |
def query(payload):
|
| 16 |
-
response = requests.post(API_URL, headers=
|
| 17 |
return response.json()
|
| 18 |
|
| 19 |
# --- UI ---
|
|
|
|
| 7 |
# Hugging Face model API
|
| 8 |
API_URL = "https://api-inference.huggingface.co/models/ibrahim313/my-imdb-sentiment-analyzer"
|
| 9 |
|
| 10 |
+
#HF_TOKEN
|
| 11 |
# Auth headers if private model
|
| 12 |
+
#headers = {}
|
| 13 |
+
#if "HF_TOKEN" in st.secrets:
|
| 14 |
+
#headers = {"Authorization": f"Bearer {HF_TOKEN']}"}
|
| 15 |
|
| 16 |
def query(payload):
|
| 17 |
+
response = requests.post(API_URL, headers="", json=payload)
|
| 18 |
return response.json()
|
| 19 |
|
| 20 |
# --- UI ---
|