Spaces:
Sleeping
Sleeping
from langchain_community.vectorstores import FAISS | |
from langchain.embeddings import SentenceTransformerEmbeddings | |
embedding_model = SentenceTransformerEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2") | |
documents = ["Mathematical modeling is used in AI, finance, and physics.", "Differential equations are part of modeling."] | |
vectorstore = FAISS.from_texts(documents, embedding_model) | |
# Save FAISS index | |
vectorstore.save_local("faiss_index") | |