OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How can I store a Vector store var some how and query from it

  • Thread starter Thread starter Bhargav - Retarded Skills
  • Start date Start date
B

Bhargav - Retarded Skills

Guest
Note: Newbie to LLM's

I want to store a vector store show how like in a pickle file or other and use it for ConversationalRetrievalChain ..

Code:
# storing embeddings in the vector store
vectorstore = FAISS.from_documents(all_splits, embeddings)

Followup code

Code:
from langchain.chains import ConversationalRetrievalChain

chain = ConversationalRetrievalChain.from_llm(llm, vectorstore.as_retriever(), return_source_documents=True)

Then

Code:
chat_history = []

query = "My query"
result = chain({"question": query, "chat_history": chat_history})

print(result['answer'])

As we can see i just need a data in vectore store var and use it for my next quires. How can i do that?
<p>Note: Newbie to LLM's</p>
<p>I want to store a vector store show how like in a <code>pickle</code> file or other and use it for <code>ConversationalRetrievalChain</code> ..</p>
<pre><code># storing embeddings in the vector store
vectorstore = FAISS.from_documents(all_splits, embeddings)
</code></pre>
<p><strong>Followup code</strong></p>
<pre><code>from langchain.chains import ConversationalRetrievalChain

chain = ConversationalRetrievalChain.from_llm(llm, vectorstore.as_retriever(), return_source_documents=True)
</code></pre>
<p>Then</p>
<pre><code>chat_history = []

query = "My query"
result = chain({"question": query, "chat_history": chat_history})

print(result['answer'])
</code></pre>
<p>As we can see i just need a data in vectore store <code>var</code> and use it for my next quires. How can i do that?</p>
 

Latest posts

Online statistics

Members online
0
Guests online
4
Total visitors
4
Ads by Eonads
Top