Illia56 commited on
Commit
4fbaa37
·
1 Parent(s): 57fce9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -39,7 +39,14 @@ st.title(TITLE)
39
  st.write(DESCRIPTION)
40
 
41
 
42
-
 
 
 
 
 
 
 
43
  # React to user input
44
  if prompt := st.chat_input("Ask Palm 2 anything..."):
45
  # Display user message in chat message container
 
39
  st.write(DESCRIPTION)
40
 
41
 
42
+ if "messages" not in st.session_state:
43
+ st.session_state.messages = []
44
+
45
+ # Display chat messages from history on app rerun
46
+ for message in st.session_state.messages:
47
+ with st.chat_message(message["role"]):
48
+ st.markdown(message["content"])
49
+
50
  # React to user input
51
  if prompt := st.chat_input("Ask Palm 2 anything..."):
52
  # Display user message in chat message container