Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,7 +5,7 @@ import json
|
|
| 5 |
import time
|
| 6 |
|
| 7 |
# Set up the Streamlit app
|
| 8 |
-
st.title("Llama Chatbot")
|
| 9 |
|
| 10 |
# Get the API key from the environment variable
|
| 11 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
|
@@ -56,7 +56,7 @@ def handle_query(query):
|
|
| 56 |
print(23, formatted_messages)
|
| 57 |
json_body = {
|
| 58 |
"inputs": formatted_messages,
|
| 59 |
-
"parameters": {"max_new_tokens":
|
| 60 |
}
|
| 61 |
data = json.dumps(json_body)
|
| 62 |
print(3, data)
|
|
@@ -84,7 +84,7 @@ for message in st.session_state.messages:
|
|
| 84 |
with st.chat_message(message['role'], avatar=icons[message['role']]):
|
| 85 |
st.write(message['content'])
|
| 86 |
|
| 87 |
-
user_prompt = st.chat_input("Ask me anything about foods")
|
| 88 |
|
| 89 |
if user_prompt:
|
| 90 |
with st.chat_message("user", avatar=icons["user"]):
|
|
|
|
| 5 |
import time
|
| 6 |
|
| 7 |
# Set up the Streamlit app
|
| 8 |
+
st.title("Llama Food Critic Chatbot")
|
| 9 |
|
| 10 |
# Get the API key from the environment variable
|
| 11 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
|
|
|
| 56 |
print(23, formatted_messages)
|
| 57 |
json_body = {
|
| 58 |
"inputs": formatted_messages,
|
| 59 |
+
"parameters": {"max_new_tokens":512, "top_p":0.5, "temperature":0.5}
|
| 60 |
}
|
| 61 |
data = json.dumps(json_body)
|
| 62 |
print(3, data)
|
|
|
|
| 84 |
with st.chat_message(message['role'], avatar=icons[message['role']]):
|
| 85 |
st.write(message['content'])
|
| 86 |
|
| 87 |
+
user_prompt = st.chat_input("Ask me anything about foods..")
|
| 88 |
|
| 89 |
if user_prompt:
|
| 90 |
with st.chat_message("user", avatar=icons["user"]):
|