Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/activeloopai/deeplake into …
Browse files Browse the repository at this point in the history
…fy_azure_fix
  • Loading branch information
FayazRahman committed Sep 8, 2023
2 parents 9e0595d + ce8fad9 commit b86f9df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deeplake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
]


__version__ = "3.6.24"
__version__ = "3.6.25"
warn_if_update_required(__version__)
__encoded_version__ = np.array(__version__)
config = {"s3": Config(max_pool_connections=50, connect_timeout=300, read_timeout=300)}
Expand Down
8 changes: 7 additions & 1 deletion deeplake/enterprise/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,9 @@ def sample_by(

def close(self):
"""Shuts down the workers and releases the resources."""
if self._internal_iterator is not None:
self._internal_iterator = None
if self._dataloader is not None:
self._dataloader.close()
self._dataloader = None

def pytorch(
Expand Down Expand Up @@ -781,8 +782,10 @@ def __iter__(self):

dataset_read(self._orig_dataset)


if self._internal_iterator is not None:
self._internal_iterator = iter(self._internal_iterator)

return self

def __next__(self):
Expand All @@ -792,6 +795,9 @@ def __next__(self):
self._internal_iterator = iter(self._dataloader)
return next(self._internal_iterator)

def __del__(self):
self.close()


def dataloader(dataset, ignore_errors: bool = False) -> DeepLakeDataLoader:
"""Returns a :class:`~deeplake.enterprise.dataloader.DeepLakeDataLoader` object which can be transformed to either pytorch dataloader or numpy.
Expand Down

0 comments on commit b86f9df

Please sign in to comment.