self.root is Path or None + The following packages are already present in the pyproject.toml and will be skipped:

- huggingface-hub

If you want to update it to the latest compatible version, you can use `poetry update package`.
If you prefer to upgrade it to the latest available version, you can use `poetry add package@latest`.

Nothing to add.
This commit is contained in:
Cadene
2024-03-15 10:56:46 +00:00
parent b10c9507d4
commit 41521f7e96
6 changed files with 15 additions and 13 deletions

View File

@@ -32,7 +32,7 @@ class AbstractExperienceReplay(TensorDictReplayBuffer):
):
self.dataset_id = dataset_id
self.shuffle = shuffle
self.root = root
self.root = root if root is None else Path(root)
storage = self._download_or_load_dataset()
super().__init__(
@@ -98,7 +98,7 @@ class AbstractExperienceReplay(TensorDictReplayBuffer):
if self.root is None:
self.data_dir = snapshot_download(repo_id=f"cadene/{self.dataset_id}", repo_type="dataset")
else:
self.data_dir = Path(self.root) / self.dataset_id
self.data_dir = self.root / self.dataset_id
return TensorStorage(TensorDict.load_memmap(self.data_dir))
def _compute_stats(self, num_batch=100, batch_size=32):