File size: 195 Bytes
9d21edd
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
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