Skip to content

Commit

Permalink
Merge pull request #2842 from activeloopai/cache_clear
Browse files Browse the repository at this point in the history
Proactively remove LRU cache values as cache fills
  • Loading branch information
nvoxland-al committed May 7, 2024
2 parents bcc2cb8 + 1cd4992 commit 5ec72ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deeplake/core/chunk_engine.py
Expand Up @@ -2157,7 +2157,7 @@ def _load_chunk(
return None, chunk_info
cache_used_percent = lambda: self.cache.cache_used / self.cache.cache_size
while cache_used_percent() > 0.9:
time.sleep(0.1)
self.cache._pop_from_cache()
base_storage = storages.get(threading.get_ident())
if base_storage is None:
if isinstance(self.base_storage, MemoryProvider):
Expand Down
5 changes: 2 additions & 3 deletions deeplake/core/index/index.py
@@ -1,3 +1,4 @@
import sys
from typing import Union, List, Tuple, Iterable, Optional
from collections.abc import Iterable
import numpy as np
Expand Down Expand Up @@ -199,9 +200,7 @@ def __getitem__(self, item: IndexValue):
def subscriptable(self):
"""Returns whether an IndexEntry can be further subscripted."""

from deeplake.enterprise.util import INDRA_INSTALLED

if INDRA_INSTALLED:
if "indra" in sys.modules:
from indra import api # type: ignore

if isinstance(self.value, api.core.IndexMappingInt64):
Expand Down

0 comments on commit 5ec72ac

Please sign in to comment.