final_year / storage /faiss_index.py
jayasrees's picture
first commit
9d21edd
raw
history blame contribute delete
195 Bytes
import faiss
import numpy as np
def create_faiss_index(embeddings):
dim = embeddings.shape[1]
index = faiss.IndexFlatL2(dim)
index.add(np.array(embeddings))
return index