Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a note to the documentation stating that the similarity method does not support embeddings other than non-quantized ones. #3131

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

pesuchin
Copy link
Contributor

Resolved: #3121

Changes

  • Updated the documentation for the similarity and similarity_pairwise methods to specify that only non-quantized embeddings are supported.
  • Added type hints to indicate that only np.float32 is supported.

If you find any issues or have concerns about these changes, please feel free to suggest adjustments.

@@ -723,14 +723,15 @@ def similarity_fn_name(
def similarity(self, embeddings1: Tensor, embeddings2: Tensor) -> Tensor: ...

@overload
def similarity(self, embeddings1: ndarray, embeddings2: ndarray) -> Tensor: ...
def similarity(self, embeddings1: npt.NDArray[np.float32], embeddings2: npt.NDArray[np.float32]) -> Tensor: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, looks to be the correct usage. I wasn't aware of these.
https://numpy.org/devdocs/reference/typing.html#numpy.typing.NDArray

@tomaarsen
Copy link
Collaborator

Very nice work! Thanks for this.

  • Tom Aarsen

@tomaarsen tomaarsen merged commit a7e8f78 into UKPLab:master Dec 12, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing Encoding Precision Yields error.
2 participants