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

Fix Numba TypingError in normalize_embedding for cosine similarity #1933

Merged
merged 2 commits into from
Jan 3, 2022

Conversation

bogdankostic
Copy link
Contributor

This PR fixes a Numba TypingError that occured when using a DocumentStore with cosine as similarity metric. There were two problems in BaseDocumentStore's normalize_embedding method:

  • Numba cannot handle the type BaseDocumentStore. Therefore, normalize_embedding needs to be a static method.
  • Numba cannot handle the axis parameter of the np.linalg.norm method (see here)

Closes #1924

@tholor tholor changed the title Fix Numba TypingError Fix Numba TypingError in normalize_embedding for cosine similarity Jan 3, 2022
@bogdankostic bogdankostic merged commit 3e0ef1c into master Jan 3, 2022
@bogdankostic bogdankostic deleted the fix_numba_error branch January 3, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FaissDocumentStore + EmbeddingRetriever: Numba TypingError when update_embeddings()
2 participants