Skip to content

Commit e1d4add

Browse files
authored
Merge pull request #35 from powerli2002/fix-demo-faiss
Fix: Correct an issue related to clearing the Faiss index in Flask4ModelCache_demo
2 parents b0977d9 + 4dd50fe commit e1d4add

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modelcache/manager/vector_data/faiss.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def search(self, data: np.ndarray, top_k: int = -1, model=None):
3434
return list(zip(dist[0], ids))
3535

3636
def rebuild_col(self, ids=None):
37-
return True
37+
try:
38+
self._index.reset()
39+
except Exception as e:
40+
return f"An error occurred during index rebuild: {e}"
3841

3942
def rebuild(self, ids=None):
4043
return True

0 commit comments

Comments
 (0)