Skip to content

Commit fd89acd

Browse files
committed
Adapting the local database for faiss integration.
1 parent fe09d27 commit fd89acd

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
@@ -23,7 +23,7 @@ def mul_add(self, datas: List[VectorData], model=None):
2323
ids = np.array(id_array)
2424
self._index.add_with_ids(np_data, ids)
2525

26-
def search(self, data: np.ndarray, top_k: int = -1):
26+
def search(self, data: np.ndarray, top_k: int = -1, model=None):
2727
if self._index.ntotal == 0:
2828
return None
2929
if top_k == -1:
@@ -33,6 +33,9 @@ def search(self, data: np.ndarray, top_k: int = -1):
3333
ids = [int(i) for i in ids[0]]
3434
return list(zip(dist[0], ids))
3535

36+
def rebuild_col(self, ids=None):
37+
return True
38+
3639
def rebuild(self, ids=None):
3740
return True
3841

0 commit comments

Comments
 (0)