Spaces:
Running
on
Zero
Running
on
Zero
Update main.py
Browse files
main.py
CHANGED
@@ -28,7 +28,7 @@ data.reset_index(inplace=True)
|
|
28 |
# Create a FAISS index for fast similarity search
|
29 |
index = faiss.IndexFlatL2(len(data["embedding"][0]))
|
30 |
index.metric_type = faiss.METRIC_INNER_PRODUCT
|
31 |
-
index.add(numpy.stack(
|
32 |
|
33 |
|
34 |
# Define the search function
|
|
|
28 |
# Create a FAISS index for fast similarity search
|
29 |
index = faiss.IndexFlatL2(len(data["embedding"][0]))
|
30 |
index.metric_type = faiss.METRIC_INNER_PRODUCT
|
31 |
+
index.add(faiss.normalize_L2(numpy.stack(data["embedding"].tolist(), axis=0)))
|
32 |
|
33 |
|
34 |
# Define the search function
|