Spaces:
Sleeping
Sleeping
Update app.py
Browse fileshide SECRET_TOKEN
app.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
import streamlit as st
|
2 |
import requests
|
|
|
|
|
3 |
|
4 |
st.title("How do you feel ?")
|
5 |
|
6 |
API_URL = "https://api-inference.huggingface.co/models/lxyuan/distilbert-base-multilingual-cased-sentiments-student"
|
7 |
-
headers = {"Authorization": "Bearer
|
8 |
|
9 |
def query(payload):
|
10 |
response = requests.post(API_URL, headers=headers, json=payload)
|
|
|
1 |
import streamlit as st
|
2 |
import requests
|
3 |
+
import os
|
4 |
+
SECRET_TOKEN = os.getenv("SECRET_TOKEN")
|
5 |
|
6 |
st.title("How do you feel ?")
|
7 |
|
8 |
API_URL = "https://api-inference.huggingface.co/models/lxyuan/distilbert-base-multilingual-cased-sentiments-student"
|
9 |
+
headers = {"Authorization": "Bearer "+SECRET_TOKEN}
|
10 |
|
11 |
def query(payload):
|
12 |
response = requests.post(API_URL, headers=headers, json=payload)
|