Skip to content

Commit 03b742b

Browse files
committed
fixed MAX_QUERIES
1 parent 2617cb4 commit 03b742b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

engine/base_client/search.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import time
33
from multiprocessing import get_context
44
from typing import Iterable, List, Optional, Tuple
5+
import itertools
56

67
import numpy as np
78
import tqdm
@@ -72,9 +73,11 @@ def search_all(
7273

7374
search_one = functools.partial(self.__class__._search_one, top=top)
7475
used_queries = queries
76+
77+
7578
if MAX_QUERIES > 0:
76-
used_queries = queries[0:MAX_QUERIES-1]
77-
print(f"limitting queries to [0:{MAX_QUERIES}]")
79+
used_queries = itertools.islice(queries, MAX_QUERIES)
80+
print(f"Limiting queries to [0:{MAX_QUERIES-1}]")
7881

7982
if parallel == 1:
8083
start = time.perf_counter()

0 commit comments

Comments
 (0)