Save the Vectors
vectorstore = SKLearnVectorStore.from_documents(
documents=doc_splits,
persist_path=PERSIST_PATH,
embedding=OllamaEmbeddings(model="Gemma-2:9b"),
serializer="parquet",
)
vectorstore.persist()
Load the Saved parquet file
vectorstore = SKLearnVectorStore(
persist_path=PERSIST_PATH,
embedding=OllamaEmbeddings(model="Gemma-2:9b"),
serializer="parquet"
)
docs = vectorstore.similarity_search(query)
*Note: PERSIST_PATH is the path where you would like to save the file and load it.
Refer: https://python.langchain.com/docs/integrations/vectorstores/sklearn/*