Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,14 @@ import requests
|
|
3 |
import spaces
|
4 |
|
5 |
API_URL = "https://api-inference.huggingface.co/models/distilbert-base-uncased-finetuned-sst-2-english"
|
6 |
-
headers = {"Authorization": "
|
7 |
|
8 |
@spaces.GPU
|
9 |
|
|
|
|
|
|
|
|
|
10 |
def analyze_sentiment(text):
|
11 |
payload = {"inputs": text}
|
12 |
try:
|
|
|
3 |
import spaces
|
4 |
|
5 |
API_URL = "https://api-inference.huggingface.co/models/distilbert-base-uncased-finetuned-sst-2-english"
|
6 |
+
headers = {"Authorization": "api_key"}
|
7 |
|
8 |
@spaces.GPU
|
9 |
|
10 |
+
|
11 |
+
api_key = os.getenv("TOKEN")
|
12 |
+
|
13 |
+
|
14 |
def analyze_sentiment(text):
|
15 |
payload = {"inputs": text}
|
16 |
try:
|