mariosasko commited on
Commit
184e359
1 Parent(s): d187349

Update danbooru2023.py

Browse files
Files changed (1) hide show
  1. danbooru2023.py +5 -1
danbooru2023.py CHANGED
@@ -28,7 +28,11 @@ class DanbooruDataset(datasets.GeneratorBasedBuilder):
28
  return info
29
 
30
  def _split_generators(self, dl_manager: DownloadManager):
31
- fs, path = url_to_fs(dl_manager._base_path)
 
 
 
 
32
  urls = fs.glob(posixpath.join(path, "**/*.tar"), detail=False)
33
  archives = dl_manager.download(["hf://" + url for url in urls])
34
  archives = [dl_manager.iter_archive(archives) for archives in archives]
 
28
  return info
29
 
30
  def _split_generators(self, dl_manager: DownloadManager):
31
+ base_path = dl_manager._base_path
32
+ if base_path.startswith(datasets.config.HF_ENDPOINT):
33
+ base_path = base_path[len(datasets.config.HF_ENDPOINT):].replace("/resolve", "", 1)
34
+ base_path = "hf://" + base_path.lstrip("/")
35
+ fs, path = url_to_fs(base_path)
36
  urls = fs.glob(posixpath.join(path, "**/*.tar"), detail=False)
37
  archives = dl_manager.download(["hf://" + url for url in urls])
38
  archives = [dl_manager.iter_archive(archives) for archives in archives]