Spaces:
Running
on
Zero
Running
on
Zero
Update main.py
Browse files
main.py
CHANGED
@@ -27,6 +27,7 @@ index = faiss.IndexFlatL2(len(data["embedding"][0]))
|
|
27 |
index.metric_type = faiss.METRIC_INNER_PRODUCT
|
28 |
vectors = numpy.stack(data["embedding"].tolist(), axis=0)
|
29 |
faiss.normalize_L2(vectors)
|
|
|
30 |
index.add(vectors)
|
31 |
|
32 |
# Load the model for later use in embeddings
|
|
|
27 |
index.metric_type = faiss.METRIC_INNER_PRODUCT
|
28 |
vectors = numpy.stack(data["embedding"].tolist(), axis=0)
|
29 |
faiss.normalize_L2(vectors)
|
30 |
+
index.train(vectors)
|
31 |
index.add(vectors)
|
32 |
|
33 |
# Load the model for later use in embeddings
|