robertselvam commited on
Commit
9f7bee0
·
verified ·
1 Parent(s): 1ee06ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -56,13 +56,6 @@ for message in st.session_state.messages:
56
  with st.chat_message(message["role"]):
57
  st.markdown(message["content"])
58
 
59
-
60
- if st.button("Reset"):
61
- st.session_state.knowledge_base = None
62
- st.session_state.messages = []
63
- st.rerun() # Rerun the script
64
-
65
-
66
  # Accept user input
67
  if question := st.chat_input("What is up?"):
68
  # Add user message to chat history
@@ -75,4 +68,10 @@ if question := st.chat_input("What is up?"):
75
  with st.chat_message("assistant"):
76
  response = docqa.run(question)
77
  st.markdown(response)
78
- st.session_state.messages.append({"role": "assistant", "content": response})
 
 
 
 
 
 
 
56
  with st.chat_message(message["role"]):
57
  st.markdown(message["content"])
58
 
 
 
 
 
 
 
 
59
  # Accept user input
60
  if question := st.chat_input("What is up?"):
61
  # Add user message to chat history
 
68
  with st.chat_message("assistant"):
69
  response = docqa.run(question)
70
  st.markdown(response)
71
+ st.session_state.messages.append({"role": "assistant", "content": response})
72
+
73
+
74
+ if st.button("Reset"):
75
+ st.session_state.knowledge_base = None
76
+ st.session_state.messages = []
77
+ st.rerun() # Rerun the script