You need to sign in or sign up before continuing.
提交 2896db53 编写于 作者: P peng.xu

Merge branch 'fix_MS-303' into 'branch-0.4.0'

fix MS-303

Closes MS-303

See merge request megasearch/milvus!341

Former-commit-id: 5667d594b565b19063f8d24ab8576c459a249180
...@@ -191,7 +191,9 @@ server::KnowhereError write_index(VecIndexPtr index, const std::string &location ...@@ -191,7 +191,9 @@ server::KnowhereError write_index(VecIndexPtr index, const std::string &location
// TODO(linxj): redo here. // TODO(linxj): redo here.
void AutoGenParams(const IndexType &type, const long &size, zilliz::knowhere::Config &cfg) { void AutoGenParams(const IndexType &type, const long &size, zilliz::knowhere::Config &cfg) {
if (!cfg.contains("nlist")) { cfg["nlist"] = int(size / 1000000.0 * 16384); } auto nlist = cfg.get_with_default("nlist", 0);
if (int(size/1000000.0) * nlist == 0) { cfg["nlist"] = int(size / 1000000.0 * 16384); }
if (!cfg.contains("gpu_id")) { cfg["gpu_id"] = int(0); } if (!cfg.contains("gpu_id")) { cfg["gpu_id"] = int(0); }
if (!cfg.contains("metric_type")) { cfg["metric_type"] = "L2"; } if (!cfg.contains("metric_type")) { cfg["metric_type"] = "L2"; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册