kaleidoskop-hug
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -75,7 +75,8 @@ def get_assistant_aswer(st_model, st_messages, st_temp_value, st_max_tokens):
|
|
75 |
return response
|
76 |
|
77 |
def retry_last():
|
78 |
-
st.session_state.messages.pop()
|
|
|
79 |
# response = get_assistant_aswer(model_links[selected_model], st.session_state.messages, temp_values, max_token_value)
|
80 |
# with st.chat_message("assistant"):
|
81 |
# st.write(response)
|
@@ -152,8 +153,8 @@ if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
|
|
152 |
|
153 |
# Display assistant response in chat message container
|
154 |
response = get_assistant_aswer(model_links[selected_model], st.session_state.messages, temp_values, max_token_value)
|
|
|
155 |
with st.chat_message("assistant"):
|
156 |
st.write(response)
|
157 |
st.button("retry", on_click=retry_last())
|
158 |
-
st.session_state.messages.append({"role": "assistant", "content": response})
|
159 |
|
|
|
75 |
return response
|
76 |
|
77 |
def retry_last():
|
78 |
+
lastmessage = st.session_state.messages.pop()
|
79 |
+
st.info(lastmessage[content])
|
80 |
# response = get_assistant_aswer(model_links[selected_model], st.session_state.messages, temp_values, max_token_value)
|
81 |
# with st.chat_message("assistant"):
|
82 |
# st.write(response)
|
|
|
153 |
|
154 |
# Display assistant response in chat message container
|
155 |
response = get_assistant_aswer(model_links[selected_model], st.session_state.messages, temp_values, max_token_value)
|
156 |
+
st.session_state.messages.append({"role": "assistant", "content": response})
|
157 |
with st.chat_message("assistant"):
|
158 |
st.write(response)
|
159 |
st.button("retry", on_click=retry_last())
|
|
|
160 |
|