Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Sep 9, 2024
1 parent b8633ba commit 6109589
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion elasticsearch/helpers/vectorstore/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6109589

Please sign in to comment.