Spaces:
Running
Running
File size: 549 Bytes
7d9087b |
1 2 3 4 5 6 7 8 9 10 11 |
from langchain_community.vectorstores import FAISS
# from langchain_community.embeddings import SentenceTransformerEmbeddings
# from langchain_community.embeddings.ollama import OllamaEmbeddings
from langchain_huggingface import HuggingFaceEmbeddings
def create_vector_store(splits):
# embeddings = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
embeddings = HuggingFaceEmbeddings(model_name="all-MiniLM-L6-v2")
# embeddings = OllamaEmbeddings(model="nomic-embed-text")
return FAISS.from_documents(splits, embeddings)
|