Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,7 +25,6 @@ with st.sidebar:
|
|
| 25 |
# Dropdown to select model
|
| 26 |
model_options = [
|
| 27 |
"deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
|
| 28 |
-
|
| 29 |
]
|
| 30 |
selected_model = st.selectbox("Select Model", model_options, index=0)
|
| 31 |
|
|
@@ -78,7 +77,10 @@ if prompt := st.chat_input("Type your message..."):
|
|
| 78 |
with st.spinner("Generating response..."):
|
| 79 |
# Prepare the payload for the API
|
| 80 |
payload = {
|
| 81 |
-
"inputs":
|
|
|
|
|
|
|
|
|
|
| 82 |
"parameters": {
|
| 83 |
"max_new_tokens": max_tokens,
|
| 84 |
"temperature": temperature,
|
|
@@ -90,7 +92,7 @@ if prompt := st.chat_input("Type your message..."):
|
|
| 90 |
# Dynamically construct the API URL based on the selected model
|
| 91 |
api_url = f"https://api-inference.huggingface.co/models/{selected_model}"
|
| 92 |
logger.info(f"Selected model: {selected_model}, API URL: {api_url}")
|
| 93 |
-
|
| 94 |
# Query the Hugging Face API using the selected model
|
| 95 |
output = query(payload, api_url)
|
| 96 |
|
|
|
|
| 25 |
# Dropdown to select model
|
| 26 |
model_options = [
|
| 27 |
"deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
|
|
|
|
| 28 |
]
|
| 29 |
selected_model = st.selectbox("Select Model", model_options, index=0)
|
| 30 |
|
|
|
|
| 77 |
with st.spinner("Generating response..."):
|
| 78 |
# Prepare the payload for the API
|
| 79 |
payload = {
|
| 80 |
+
"inputs": {
|
| 81 |
+
"system_message": system_message,
|
| 82 |
+
"user_message": prompt
|
| 83 |
+
},
|
| 84 |
"parameters": {
|
| 85 |
"max_new_tokens": max_tokens,
|
| 86 |
"temperature": temperature,
|
|
|
|
| 92 |
# Dynamically construct the API URL based on the selected model
|
| 93 |
api_url = f"https://api-inference.huggingface.co/models/{selected_model}"
|
| 94 |
logger.info(f"Selected model: {selected_model}, API URL: {api_url}")
|
| 95 |
+
print("payload:",payload)
|
| 96 |
# Query the Hugging Face API using the selected model
|
| 97 |
output = query(payload, api_url)
|
| 98 |
|