Merge pull request #30 from Cadene/user/rcadene/2024_03_15_fix_path

Use Path type instead of str for data_dir
This commit is contained in:
Remi 2024-03-15 14:41:33 +01:00 committed by GitHub
commit 58d1787ee3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ class AbstractExperienceReplay(TensorDictReplayBuffer):
def _download_or_load_dataset(self) -> torch.StorageBase: def _download_or_load_dataset(self) -> torch.StorageBase:
if self.root is None: if self.root is None:
self.data_dir = snapshot_download(repo_id=f"cadene/{self.dataset_id}", repo_type="dataset") self.data_dir = Path(snapshot_download(repo_id=f"cadene/{self.dataset_id}", repo_type="dataset"))
else: else:
self.data_dir = self.root / self.dataset_id self.data_dir = self.root / self.dataset_id
return TensorStorage(TensorDict.load_memmap(self.data_dir)) return TensorStorage(TensorDict.load_memmap(self.data_dir))