Update app.py
Browse files
app.py
CHANGED
@@ -83,9 +83,6 @@ selected_model = st.sidebar.selectbox("Select Model", models)
|
|
83 |
# Create a temperature slider
|
84 |
temp_values = st.sidebar.slider('Select a temperature value', 0.0, 1.0, (0.5))
|
85 |
|
86 |
-
# Add a system prompt input
|
87 |
-
system_prompt = st.sidebar.text_input("System Prompt")
|
88 |
-
|
89 |
|
90 |
#Add reset button to clear conversation
|
91 |
st.sidebar.button('Reset Chat', on_click=reset_conversation) #Reset button
|
@@ -140,10 +137,7 @@ if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|
|
140 |
st.markdown(prompt)
|
141 |
# Add user message to chat history
|
142 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
143 |
-
|
144 |
-
# Add system prompt to chat history if it exists
|
145 |
-
if system_prompt:
|
146 |
-
st.session_state.messages.append({"role": "system", "content": system_prompt})
|
147 |
|
148 |
# Display assistant response in chat message container
|
149 |
with st.chat_message("assistant"):
|
@@ -175,4 +169,9 @@ if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|
|
175 |
st.write("This was the error message:")
|
176 |
st.write(e)
|
177 |
|
|
|
|
|
|
|
|
|
|
|
178 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
|
|
83 |
# Create a temperature slider
|
84 |
temp_values = st.sidebar.slider('Select a temperature value', 0.0, 1.0, (0.5))
|
85 |
|
|
|
|
|
|
|
86 |
|
87 |
#Add reset button to clear conversation
|
88 |
st.sidebar.button('Reset Chat', on_click=reset_conversation) #Reset button
|
|
|
137 |
st.markdown(prompt)
|
138 |
# Add user message to chat history
|
139 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
140 |
+
|
|
|
|
|
|
|
141 |
|
142 |
# Display assistant response in chat message container
|
143 |
with st.chat_message("assistant"):
|
|
|
169 |
st.write("This was the error message:")
|
170 |
st.write(e)
|
171 |
|
172 |
+
|
173 |
+
|
174 |
+
|
175 |
+
|
176 |
+
|
177 |
st.session_state.messages.append({"role": "assistant", "content": response})
|