Skip to content

Commit

Permalink
Add flushing
Browse files Browse the repository at this point in the history
  • Loading branch information
adolkhan committed Aug 7, 2023
1 parent 697f19d commit 1632d5c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions deeplake/core/vectorstore/deeplake_vectorstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numpy as np

from deeplake.core.vector_index.distance_type import DistanceType
from deeplake.util.dataset import try_flushing

try:
from indra import api # type: ignore
Expand Down Expand Up @@ -268,6 +269,8 @@ def add(
},
)

try_flushing(self.dataset)

(
embedding_function,
embedding_data,
Expand Down Expand Up @@ -414,6 +417,8 @@ def search(
},
)

try_flushing(self.dataset)

if exec_option is None and self.exec_option != "python" and callable(filter):
logger.warning(
'Switching exec_option to "python" (runs on client) because filter is specified as a function. '
Expand Down Expand Up @@ -529,6 +534,8 @@ def delete(
},
)

try_flushing(self.dataset)

if not row_ids:
row_ids = dataset_utils.search_row_ids(
dataset=self.dataset,
Expand Down Expand Up @@ -622,6 +629,8 @@ def update_embedding(
},
)

try_flushing(self.dataset)

(
embedding_function,
embedding_source_tensor,
Expand Down Expand Up @@ -680,6 +689,7 @@ def delete_by_path(
{"creds": creds},
token=token,
)

deeplake.delete(path, large_ok=True, token=token, force=True, creds=creds)

def commit(self, allow_empty: bool = True) -> None:
Expand Down

0 comments on commit 1632d5c

Please sign in to comment.