Illia56 commited on
Commit
31ed649
1 Parent(s): 4830ddf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -32,7 +32,14 @@ st.title(TITLE)
32
  st.write(DESCRIPTION)
33
 
34
 
35
-
 
 
 
 
 
 
 
36
  # React to user input
37
  if prompt := st.chat_input("Ask LLama-2-70b anything..."):
38
  # Display user message in chat message container
 
32
  st.write(DESCRIPTION)
33
 
34
 
35
+ if "messages" not in st.session_state:
36
+ st.session_state.messages = []
37
+
38
+ # Display chat messages from history on app rerun
39
+ for message in st.session_state.messages:
40
+ with st.chat_message(message["role"]):
41
+ st.markdown(message["content"])
42
+
43
  # React to user input
44
  if prompt := st.chat_input("Ask LLama-2-70b anything..."):
45
  # Display user message in chat message container