Update app.py
Browse files31 unmodified lines3233343536373839404 unmodified lines454647484950515231 unmodified lines# Create a conversational chain with retrieval capabilitiesmemory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)qa_chain = ConversationalRetrievalChain.from_llm(llm,retriever=vectorstore.as_retriever(), memory=memory)def upload_docs(docs):# Load and process the uploaded PDF documents4 unmodified lines# Split documents into manageable chunkstext_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)texts = text_splitter.split_documents(loaded_docs)# Add documents to the vector store and persist themvectorstore.add_documents(texts)31 unmodified lines323334353637384 unmodified lines4344454647484931 unmodified lines# Create a conversational chain with retrieval capabilitiesmemory = ConversationBufferMemory(memory_key="chat_history", return_messages=True)qa_chain = ConversationalRetrievalChain.from_llm(llm, retriever=vectorstore.as_retriever(), memory=memory)def upload_docs(docs):# Load and process the uploaded PDF documents4 unmodified lines# Split documents into manageable chunkstext_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)texts = text_splitter.split_documents(loaded_docs)# Add documents to the vector store and persist themvectorstore.add_documents(texts)
app.py+2-5