ageraustine commited on
Commit
105edfc
1 Parent(s): a7bd912

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -101,7 +101,7 @@ clear_button = st.sidebar.button("Clear Conversation", key="clear")
101
 
102
  # Initialise session state variables
103
  if 'generated' not in st.session_state:
104
- st.session_state['generated'] = []
105
  if 'past' not in st.session_state:
106
  st.session_state['past'] = []
107
  if 'messages' not in st.session_state:
@@ -134,15 +134,15 @@ with container:
134
  st.session_state['messages'].append({"role": "assistant", "content": value.content})
135
  st.session_state['past'].append(user_input)
136
  st.session_state['generated'].append(value.content)
 
 
137
 
138
  if st.session_state['generated']:
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
 
 
101
 
102
  # Initialise session state variables
103
  if 'generated' not in st.session_state:
104
+ st.session_state['generated'] = ['Please tell me about your most recent career']
105
  if 'past' not in st.session_state:
106
  st.session_state['past'] = []
107
  if 'messages' not in st.session_state:
 
134
  st.session_state['messages'].append({"role": "assistant", "content": value.content})
135
  st.session_state['past'].append(user_input)
136
  st.session_state['generated'].append(value.content)
137
+
138
+ message("Please tell me about your most recent career")
139
 
140
  if st.session_state['generated']:
141
  with response_container:
 
142
  for i in range(len(st.session_state['generated'])):
143
+ message(st.session_state["generated"][i], key=str(i))
144
+ if len(st.session_state["past"]) > 0:
145
+ message(st.session_state["past"][i], is_user=True, key=str(i) + '_user')
146
 
147
+
 
148