Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,8 +19,8 @@ if "messages" not in st.session_state:
|
|
| 19 |
|
| 20 |
# Sidebar configuration
|
| 21 |
with st.sidebar:
|
| 22 |
-
st.header("Model Configuration")
|
| 23 |
-
st.markdown("[Get HuggingFace Token](https://huggingface.co/settings/tokens)")
|
| 24 |
|
| 25 |
# Dropdown to select model
|
| 26 |
model_options = [
|
|
@@ -51,9 +51,9 @@ with st.sidebar:
|
|
| 51 |
|
| 52 |
# Function to query the Hugging Face API
|
| 53 |
def query(payload, api_url):
|
| 54 |
-
headers = {"Authorization": f"Bearer {st.secrets['HF_TOKEN']}"}
|
| 55 |
logger.info(f"Sending request to {api_url} with payload: {payload}")
|
| 56 |
-
response = requests.post(api_url, headers=headers,
|
| 57 |
logger.info(f"Received response: {response.status_code}, {response.text}")
|
| 58 |
try:
|
| 59 |
return response.json()
|
|
|
|
| 19 |
|
| 20 |
# Sidebar configuration
|
| 21 |
with st.sidebar:
|
| 22 |
+
#st.header("Model Configuration")
|
| 23 |
+
#st.markdown("[Get HuggingFace Token](https://huggingface.co/settings/tokens)")
|
| 24 |
|
| 25 |
# Dropdown to select model
|
| 26 |
model_options = [
|
|
|
|
| 51 |
|
| 52 |
# Function to query the Hugging Face API
|
| 53 |
def query(payload, api_url):
|
| 54 |
+
#headers = {"Authorization": f"Bearer {st.secrets['HF_TOKEN']}"}
|
| 55 |
logger.info(f"Sending request to {api_url} with payload: {payload}")
|
| 56 |
+
response = requests.post(api_url, json=payload) #headers=headers,
|
| 57 |
logger.info(f"Received response: {response.status_code}, {response.text}")
|
| 58 |
try:
|
| 59 |
return response.json()
|