Skip to content

Commit

Permalink
optimize faiss hnsw refine check error msg (#945)
Browse files Browse the repository at this point in the history
Signed-off-by: xianliang.li <[email protected]>
  • Loading branch information
foxspy authored Nov 14, 2024
1 parent f8ab12c commit cda1aac
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/index/hnsw/faiss_hnsw_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ class FaissHnswSqConfig : public FaissHnswConfig {
// check refine
if (refine_type.has_value()) {
if (!WhetherAcceptableRefineType(refine_type.value())) {
std::string msg = "invalid refine type type";
std::string msg =
"invalid refine type : " + refine_type.value() + ", optional types are [sq6, sq8, fp16, bf16]";
return HandleError(err_msg, msg, Status::invalid_args);
}
}
Expand Down Expand Up @@ -181,11 +182,9 @@ class FaissHnswPqConfig : public FaissHnswConfig {
// check refine
if (refine_type.has_value()) {
if (!WhetherAcceptableRefineType(refine_type.value())) {
if (err_msg) {
*err_msg = "invalid refine type type";
LOG_KNOWHERE_ERROR_ << *err_msg;
}
return Status::invalid_args;
std::string msg = "invalid refine type : " + refine_type.value() +
", optional types are [sq6, sq8, fp16, bf16, fp32, flat]";
return HandleError(err_msg, msg, Status::invalid_args);
}
}
}
Expand Down Expand Up @@ -234,11 +233,9 @@ class FaissHnswPrqConfig : public FaissHnswConfig {
// check refine
if (refine_type.has_value()) {
if (!WhetherAcceptableRefineType(refine_type.value())) {
if (err_msg) {
*err_msg = "invalid refine type type";
LOG_KNOWHERE_ERROR_ << *err_msg;
}
return Status::invalid_args;
std::string msg = "invalid refine type : " + refine_type.value() +
", optional types are [sq6, sq8, fp16, bf16, fp32, flat]";
return HandleError(err_msg, msg, Status::invalid_args);
}
}
}
Expand Down

0 comments on commit cda1aac

Please sign in to comment.