From 610958997e6684b7482735f91d60098a456cb6d4 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 9 Sep 2024 16:37:29 +0400 Subject: [PATCH] Fix lint --- elasticsearch/helpers/vectorstore/_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elasticsearch/helpers/vectorstore/_utils.py b/elasticsearch/helpers/vectorstore/_utils.py index df91b5cc9..d8f7b339f 100644 --- a/elasticsearch/helpers/vectorstore/_utils.py +++ b/elasticsearch/helpers/vectorstore/_utils.py @@ -100,7 +100,8 @@ def _cosine_similarity(X: Matrix, Y: Matrix) -> "npt.NDArray[np.float64]": X = np.array(X, dtype=np.float32) Y = np.array(Y, dtype=np.float32) - Z = 1 - np.array(simd.cdist(X, Y, metric="cosine")) + # https://github.com/ashvardanian/SimSIMD/issues/171 + Z = 1 - np.array(simd.cdist(X, Y, metric="cosine")) # type: ignore[arg-type] if isinstance(Z, float): return np.array([Z]) return np.array(Z)