ageraustine commited on
Commit
a7bd912
1 Parent(s): f6568b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -110,14 +110,11 @@ if 'messages' not in st.session_state:
110
 
111
  # reset everything
112
  if clear_button:
113
- st.session_state['generated'] = []
114
  st.session_state['past'] = []
115
- st.session_state['messages'] = [
116
- {"role": "assistant", "content": "Please tell me about your most recent profession"}
117
- ]
118
 
119
 
120
-
121
  # container for chat history
122
  response_container = st.container()
123
  # container for text box
@@ -142,5 +139,10 @@ if st.session_state['generated']:
142
  with response_container:
143
  message("Please tell me about your most recent career")
144
  for i in range(len(st.session_state['generated'])):
145
- message(st.session_state["past"][i], is_user=True, key=str(i) + '_user')
146
- message(st.session_state["generated"][i], key=str(i))
 
 
 
 
 
 
110
 
111
  # reset everything
112
  if clear_button:
113
+ st.session_state['generated'] = ['Please tell me about your most recent career']
114
  st.session_state['past'] = []
115
+ st.session_state['messages'] = []
 
 
116
 
117
 
 
118
  # container for chat history
119
  response_container = st.container()
120
  # container for text box
 
139
  with response_container:
140
  message("Please tell me about your most recent career")
141
  for i in range(len(st.session_state['generated'])):
142
+ if len(st.session_stae['past']) > 0
143
+ message(st.session_state["generated"][i+1], key=str(i+1))
144
+ message(st.session_state["past"][i], is_user=True, key=str(i) + '_user')
145
+
146
+ else:
147
+ message(st.session_state["generated"][i], key=str(i))
148
+