Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,10 @@ import os
|
|
4 |
from streamlit_chat import message
|
5 |
|
6 |
|
7 |
-
api_token = os.getenv("api_token")
|
8 |
-
model_id = "deepset/roberta-base-squad2"
|
9 |
@st.cache
|
10 |
-
def query(payload
|
|
|
|
|
11 |
headers = {"Authorization": f"Bearer {api_token}"}
|
12 |
API_URL = f"https://api-inference.huggingface.co/models/{model_id}"
|
13 |
response = requests.post(API_URL, headers=headers, json=payload)
|
|
|
4 |
from streamlit_chat import message
|
5 |
|
6 |
|
|
|
|
|
7 |
@st.cache
|
8 |
+
def query(payload):
|
9 |
+
api_token = os.getenv("api_token")
|
10 |
+
model_id = "deepset/roberta-base-squad2"
|
11 |
headers = {"Authorization": f"Bearer {api_token}"}
|
12 |
API_URL = f"https://api-inference.huggingface.co/models/{model_id}"
|
13 |
response = requests.post(API_URL, headers=headers, json=payload)
|