genaibeauty commited on
Commit
1e3e963
Β·
verified Β·
1 Parent(s): e3b502f

Update vector_store.py

Browse files
Files changed (1) hide show
  1. vector_store.py +4 -4
vector_store.py CHANGED
@@ -1,12 +1,12 @@
1
  import faiss
2
  from langchain.vectorstores import FAISS
3
  from langchain.schema import Document
4
- from embeddings import embedding_model # Correct the import to directly reference the embeddings.py file
5
 
6
- # Initialize FAISS index
7
- dim = 384 # MiniLM embedding size
8
  index = faiss.IndexFlatL2(dim)
9
- vector_db = FAISS(embedding_function=embedding_model, index=index)
10
 
11
  def add_document(text, doc_id):
12
  """Add document embeddings to FAISS."""
 
1
  import faiss
2
  from langchain.vectorstores import FAISS
3
  from langchain.schema import Document
4
+ from embeddings import get_embedding # Import the updated embedding function
5
 
6
+ # FAISS parameters
7
+ dim = 384 # Size of the embedding (MiniLM has 384-dimensional vectors)
8
  index = faiss.IndexFlatL2(dim)
9
+ vector_db = FAISS(embedding_function=get_embedding, index=index)
10
 
11
  def add_document(text, doc_id):
12
  """Add document embeddings to FAISS."""