Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def get_conversation_chain(vectorstore:FAISS) -> ConversationalRetrievalChain:
|
|
58 |
model_kwargs={"temperature": 0.9, "max_length": 2048},
|
59 |
)
|
60 |
|
61 |
-
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=
|
62 |
conversation_chain = ConversationalRetrievalChain.from_llm(
|
63 |
llm=llm, retriever=vectorstore.as_retriever(),memory=memory
|
64 |
)
|
@@ -67,7 +67,7 @@ def get_conversation_chain(vectorstore:FAISS) -> ConversationalRetrievalChain:
|
|
67 |
|
68 |
def handle_userinput(user_question:str):
|
69 |
response = st.session_state.conversation({"question": user_question})
|
70 |
-
|
71 |
|
72 |
for i, message in enumerate(st.session_state.chat_history):
|
73 |
if i % 2 == 0:
|
|
|
58 |
model_kwargs={"temperature": 0.9, "max_length": 2048},
|
59 |
)
|
60 |
|
61 |
+
memory = ConversationBufferMemory(memory_key="chat_history", return_messages=False)
|
62 |
conversation_chain = ConversationalRetrievalChain.from_llm(
|
63 |
llm=llm, retriever=vectorstore.as_retriever(),memory=memory
|
64 |
)
|
|
|
67 |
|
68 |
def handle_userinput(user_question:str):
|
69 |
response = st.session_state.conversation({"question": user_question})
|
70 |
+
st.session_state.chat_history = response["chat_history"]
|
71 |
|
72 |
for i, message in enumerate(st.session_state.chat_history):
|
73 |
if i % 2 == 0:
|