Skip to content

Commit 4b0c86f

Browse files
ricecakey06Gak123Tps-F
authored
add project name to index file's name (#357)
* Add files via upload * Apply Code Formatter Change --------- Co-authored-by: gak123 <[email protected]> Co-authored-by: Ftps <[email protected]>
1 parent 2280f3e commit 4b0c86f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

infer-web.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -789,8 +789,8 @@ def train_index(exp_dir1, version19):
789789
index.train(big_npy)
790790
faiss.write_index(
791791
index,
792-
"%s/trained_IVF%s_Flat_nprobe_%s_%s.index"
793-
% (exp_dir, n_ivf, index_ivf.nprobe, version19),
792+
"%s/trained_IVF%s_Flat_nprobe_%s_%s_%s.index"
793+
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
794794
)
795795
# faiss.write_index(index, '%s/trained_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
796796
infos.append("adding")
@@ -800,12 +800,12 @@ def train_index(exp_dir1, version19):
800800
index.add(big_npy[i : i + batch_size_add])
801801
faiss.write_index(
802802
index,
803-
"%s/added_IVF%s_Flat_nprobe_%s_%s.index"
804-
% (exp_dir, n_ivf, index_ivf.nprobe, version19),
803+
"%s/added_IVF%s_Flat_nprobe_%s_%s_%s.index"
804+
% (exp_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
805805
)
806806
infos.append(
807-
"成功构建索引,added_IVF%s_Flat_nprobe_%s_%s.index"
808-
% (n_ivf, index_ivf.nprobe, version19)
807+
"成功构建索引,added_IVF%s_Flat_nprobe_%s_%s_%s.index"
808+
% (n_ivf, index_ivf.nprobe, exp_dir1, version19)
809809
)
810810
# faiss.write_index(index, '%s/added_IVF%s_Flat_FastScan_%s.index'%(exp_dir,n_ivf,version19))
811811
# infos.append("成功构建索引,added_IVF%s_Flat_FastScan_%s.index"%(n_ivf,version19))
@@ -1029,21 +1029,21 @@ def get_info_str(strr):
10291029
index.train(big_npy)
10301030
faiss.write_index(
10311031
index,
1032-
"%s/trained_IVF%s_Flat_nprobe_%s_%s.index"
1033-
% (model_log_dir, n_ivf, index_ivf.nprobe, version19),
1032+
"%s/trained_IVF%s_Flat_nprobe_%s_%s_%s.index"
1033+
% (model_log_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
10341034
)
10351035
yield get_info_str("adding index")
10361036
batch_size_add = 8192
10371037
for i in range(0, big_npy.shape[0], batch_size_add):
10381038
index.add(big_npy[i : i + batch_size_add])
10391039
faiss.write_index(
10401040
index,
1041-
"%s/added_IVF%s_Flat_nprobe_%s_%s.index"
1042-
% (model_log_dir, n_ivf, index_ivf.nprobe, version19),
1041+
"%s/added_IVF%s_Flat_nprobe_%s_%s_%s.index"
1042+
% (model_log_dir, n_ivf, index_ivf.nprobe, exp_dir1, version19),
10431043
)
10441044
yield get_info_str(
1045-
"成功构建索引, added_IVF%s_Flat_nprobe_%s_%s.index"
1046-
% (n_ivf, index_ivf.nprobe, version19)
1045+
"成功构建索引, added_IVF%s_Flat_nprobe_%s_%s_%s.index"
1046+
% (n_ivf, index_ivf.nprobe, exp_dir1, version19)
10471047
)
10481048
yield get_info_str(i18n("全流程结束!"))
10491049

0 commit comments

Comments
 (0)