-
Notifications
You must be signed in to change notification settings - Fork 328
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
add retry for download index & support MipsSquaredEuclidean #2134
base: master
Are you sure you want to change the base?
Conversation
|
||
def read_index(): | ||
with open(local_path, 'wb') as out_f: | ||
with fs.open(index_path, 'rb') as in_f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with-block can hold multiple contexts, such as with func1() as v1, func2() as v2
.
logger.warning(f"read success") | ||
break | ||
except: # noqa: E722 # nosec # pylint: disable=bare-except | ||
logger.warning(f"read index file faild for times {_}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed for {n} times
break | ||
|
||
# retry 3 times | ||
for _ in range(3): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a variable name instead of _
@@ -406,7 +420,7 @@ def _execute_agg(cls, ctx, op: "ProximaSearcher"): | |||
topk = op.topk | |||
|
|||
# calculate topk on rows | |||
if op.distance_metric == "InnerProduct": | |||
if op.distance_metric == "InnerProduct" or op.distance_metric == "MipsSquaredEuclidean": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use op.distance_metric in ('InnerProduct', 'MipsSquaredEuclidean')
?
What do these changes do?
Related issue number
no issue number