lfoppiano commited on
Commit
048eb6f
1 Parent(s): a2bcc71

clear memory only when enabled

Browse files
Files changed (1) hide show
  1. streamlit_app.py +2 -1
streamlit_app.py CHANGED
@@ -106,7 +106,8 @@ def new_file():
106
  st.session_state['loaded_embeddings'] = None
107
  st.session_state['doc_id'] = None
108
  st.session_state['uploaded'] = True
109
- st.session_state['memory'].clear()
 
110
 
111
 
112
  def clear_memory():
 
106
  st.session_state['loaded_embeddings'] = None
107
  st.session_state['doc_id'] = None
108
  st.session_state['uploaded'] = True
109
+ if st.session_state['memory']:
110
+ st.session_state['memory'].clear()
111
 
112
 
113
  def clear_memory():