-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up query_by_embedding in InMemoryDocumentStore. (#2091)
* Speed up query_by_embedding in InMemoryDocumentStore. * Make sure query and document embeddings are of the same dtype since they can vary. * Handle cases where there are 0 and 1 documents. * Don't put entire embedding matrix on GPU at once. Use separate get_score functions for the CPU and GPU. * Norm the vectors in get_scores_numpy in a safer way. * Apply Black * Incorporate missing factor of 4 in memory use calculation. * Apply Black Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
518a439
commit d3c7768
Showing
1 changed file
with
99 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters