Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramyrahmeni committed Jun 17, 2024
1 parent 3df1f39 commit e0ece84
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ def main():
if btn:
if query:
with st.spinner('Generating response...'):
rep=ask(query,st.session_state.embedding_model,st.session_state.embeddings,st.session_state.pages_and_chunks)
rep=ask(query,st.session_state.embedding_model,embeddings,pages_and_chunks)
st.write("\n\n")
for message in reversed(st.session_state.chat_session.history):
if message.role=="user":
Expand All @@ -412,10 +412,5 @@ def main():
with st.chat_message(translate_role_for_streamlit(message.role)):
st.markdown(message.parts[0].text)

else:
if "embeddings" in st.session_state:
del st.session_state.embeddings
gc.collect()

if __name__ == "__main__":
main()

0 comments on commit e0ece84

Please sign in to comment.