Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
pmpailis committed Nov 22, 2023
1 parent 4397a60 commit 0d5ed44
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions dense_vector/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@ def load_query_vectors(queries_file):
return query_vectors


async def extract_exact_neighbors(
query_vector: List[float],
index: str,
max_size: int,
vector_field: str,
client
) -> List[str]:
async def extract_exact_neighbors(query_vector: List[float], index: str, max_size: int, vector_field: str, client) -> List[str]:
script_query = await client.search(
body={
"query": {
Expand Down Expand Up @@ -58,8 +52,9 @@ async def get_neighbors_for_query(self, index: str, query_id: str, size: int, cl
logger.debug(f"Fetching exact neighbors for {query_id} from in-memory store")
exact_neighbors = self._store[index][query_id]
if not exact_neighbors or len(exact_neighbors) < size:
logger.debug(f"Query vector with id {query_id} not cached or has fewer then {size} requested results"
f" - computing neighbors")
logger.debug(
f"Query vector with id {query_id} not cached or has fewer then {size} requested results" f" - computing neighbors"
)
self._store[index][query_id] = await self.load_exact_neighbors(index, query_id, size, client)
logger.debug(f"Finished computing exact neighbors for {query_id} - it's now cached!")
return self._store[index][query_id]
Expand Down

0 comments on commit 0d5ed44

Please sign in to comment.