merve HF staff commited on
Commit
050bcdd
1 Parent(s): 9508bc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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, model_id, api_token):
 
 
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)