Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -39,7 +39,7 @@ chatmodel = transformers.AutoModelForCausalLM.from_pretrained(
|
|
39 |
|
40 |
# Create a FAISS index for fast similarity search
|
41 |
metric = faiss.METRIC_INNER_PRODUCT
|
42 |
-
vectors = numpy.stack(data["embedding"].tolist(), axis=0)
|
43 |
index = faiss.IndexFlatL2(len(data["embedding"][0]))
|
44 |
index.metric_type = metric
|
45 |
faiss.normalize_L2(vectors)
|
|
|
39 |
|
40 |
# Create a FAISS index for fast similarity search
|
41 |
metric = faiss.METRIC_INNER_PRODUCT
|
42 |
+
vectors = numpy.stack(data["embedding"].tolist(), axis=0).astype('float32')
|
43 |
index = faiss.IndexFlatL2(len(data["embedding"][0]))
|
44 |
index.metric_type = metric
|
45 |
faiss.normalize_L2(vectors)
|