You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm not able to load the index from disk in python.
I saved an index in this way:
index = HnswIndex(d, distance)
for sample in documents:
index.add_data(sample)
index.build(m=m, max_m0=m0, ef_construction=ef_construction, n_threads=n_threads, neighbor_selecting="heuristic")
index.save(index_path)
The index is indeed saved, I see its memory occupancy on the disk.
Then I load it in this way:
index_n2 = HnswIndex(d)
loaded = index_n2.load(path_n2)
if loaded:
print("Loaded n2 index")
else:
print("Failed to load n2 index")
But the load fails, it prints "Failed to load n2 index" and I don't see it in main memory.
Why does this happen? What am I doing wrong?
The text was updated successfully, but these errors were encountered:
SilvioM97
changed the title
Index is not loading from memory
Index is not loading from disk
Oct 3, 2024
In n2, virtual memory is pre-allocated on model load, and disk -> memory actually happens at inference time. This may have caused you to miss something in your memory check, so you may want to check that as well.
Hi,
I'm not able to load the index from disk in python.
I saved an index in this way:
The index is indeed saved, I see its memory occupancy on the disk.
Then I load it in this way:
But the load fails, it prints "Failed to load n2 index" and I don't see it in main memory.
Why does this happen? What am I doing wrong?
The text was updated successfully, but these errors were encountered: