Commit c5eef346 authored by 赵威's avatar 赵威

try write index

parent 09e238cb
...@@ -70,8 +70,9 @@ def save_faiss_index(load_file, save_path): ...@@ -70,8 +70,9 @@ def save_faiss_index(load_file, save_path):
print(ids_np) print(ids_np)
print(features_np) print(features_np)
index = faiss.IndexHNSWFlat(128, 32) index = faiss.IndexHNSWFlat(128, 32)
print(index.is_trained)
index2 = faiss.IndexIDMap(index) index2 = faiss.IndexIDMap(index)
index2.add_with_ids(features_np, ids_np) index2.add_with_ids(len(ids), features_np, ids_np)
faiss.write_index(index2, save_path) faiss.write_index(index2, save_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment