Skip to content

Commit

Permalink
No need for dataset_info (#7234)
Browse files Browse the repository at this point in the history
* no need for dataset_info

* actually do a single call in dataset_module_factory

* update tests

* fix tests

* again

* again

* better check for gated error response code
  • Loading branch information
lhoestq authored Oct 21, 2024
1 parent d4422cc commit 59738d7
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 114 deletions.
6 changes: 5 additions & 1 deletion src/datasets/download/download_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ def _download_batched(
download_func = partial(self._download_single, download_config=download_config)

fs: fsspec.AbstractFileSystem
fs, path = url_to_fs(url_or_filenames[0], **download_config.storage_options)
path = str(url_or_filenames[0])
if is_relative_path(path):
# append the relative path to the base_path
path = url_or_path_join(self._base_path, path)
fs, path = url_to_fs(path, **download_config.storage_options)
size = 0
try:
size = fs.info(path).get("size", 0)
Expand Down
Loading

0 comments on commit 59738d7

Please sign in to comment.