kaleidoskop-hug
commited on
Commit
•
0cafb36
1
Parent(s):
0441833
Update app.py
Browse files
app.py
CHANGED
@@ -127,14 +127,14 @@ for message in st.session_state.messages:
|
|
127 |
st.markdown(message["content"])
|
128 |
|
129 |
|
130 |
-
if st.
|
131 |
lastmessage = st.session_state.messages.pop()
|
132 |
st.toast("popped msg: " + lastmessage["content"] + " // model: " + model_links[selected_model])
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
|
139 |
|
140 |
|
@@ -152,4 +152,5 @@ if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|
|
152 |
st.write(response)
|
153 |
|
154 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
155 |
-
|
|
|
|
127 |
st.markdown(message["content"])
|
128 |
|
129 |
|
130 |
+
if st.sesseion_state.retry:
|
131 |
lastmessage = st.session_state.messages.pop()
|
132 |
st.toast("popped msg: " + lastmessage["content"] + " // model: " + model_links[selected_model])
|
133 |
+
response = get_assistant_aswer(model_links[selected_model], st.session_state.messages, temp_values, max_token_value)
|
134 |
+
with st.chat_message("assistant"):
|
135 |
+
st.write(response)
|
136 |
+
st.button("retry", on_click=retry_last())
|
137 |
+
st.session_state.messages.append({"role": "assistant", "content": response})
|
138 |
|
139 |
|
140 |
|
|
|
152 |
st.write(response)
|
153 |
|
154 |
st.session_state.messages.append({"role": "assistant", "content": response})
|
155 |
+
|
156 |
+
st.button("retry", key="retry")
|