Update app.py
Browse files
app.py
CHANGED
@@ -46,15 +46,15 @@ def get_vectorstore(text_chunks):
|
|
46 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
47 |
return vectorstore
|
48 |
|
49 |
-
|
50 |
def get_conversation_chain(vectorstore):
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
|
|
|
56 |
memory = ConversationBufferMemory(
|
57 |
-
memory_key='chat_history', return_messages=True
|
|
|
|
|
58 |
conversation_chain = ConversationalRetrievalChain.from_llm(
|
59 |
llm=llm,
|
60 |
retriever=vectorstore.as_retriever(),
|
|
|
46 |
vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
|
47 |
return vectorstore
|
48 |
|
|
|
49 |
def get_conversation_chain(vectorstore):
|
50 |
+
# llm = ChatOpenAI()
|
51 |
+
llm = HuggingFaceEndpoint(repo_id="google/flan-t5-base", model_kwargs={"temperature": 0.5, "max_length": 256})
|
|
|
|
|
52 |
|
53 |
+
# Correct the indentation here
|
54 |
memory = ConversationBufferMemory(
|
55 |
+
memory_key='chat_history', return_messages=True
|
56 |
+
)
|
57 |
+
|
58 |
conversation_chain = ConversationalRetrievalChain.from_llm(
|
59 |
llm=llm,
|
60 |
retriever=vectorstore.as_retriever(),
|