kaleidoskop-hug commited on
Commit
0441833
1 Parent(s): aa0a05f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -70,17 +70,6 @@ def get_assistant_aswer(st_model, st_messages, st_temp_value, st_max_tokens):
70
 
71
  return response
72
 
73
- def retry_last():
74
- lastmessage = st.session_state.messages.pop()
75
- st.toast("popped msg: " + lastmessage["content"] + " // model: " + model_links[selected_model])
76
- #response = get_assistant_aswer(model_links[selected_model], st.session_state.messages, temp_values, max_token_value)
77
- # with st.chat_message("assistant"):
78
- # st.write(response)
79
- # st.button("retry", on_click=retry_last())
80
- # st.session_state.messages.append({"role": "assistant", "content": response})
81
- return None
82
-
83
-
84
  # Define the available models
85
  models =[key for key in model_links.keys()]
86
 
@@ -138,8 +127,16 @@ for message in st.session_state.messages:
138
  st.markdown(message["content"])
139
 
140
 
141
- if st.button("retry", key=retry):
142
- retry_last()
 
 
 
 
 
 
 
 
143
 
144
  # Accept user input
145
  if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):
 
70
 
71
  return response
72
 
 
 
 
 
 
 
 
 
 
 
 
73
  # Define the available models
74
  models =[key for key in model_links.keys()]
75
 
 
127
  st.markdown(message["content"])
128
 
129
 
130
+ if st.button("retry", key="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
 
141
  # Accept user input
142
  if prompt := st.chat_input(f"Hi I'm {selected_model}, ask me a question"):