Skip to content

Commit

Permalink
Transform all HF HTTP URLs to HF protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Jul 24, 2024
1 parent 5142a8c commit a337212
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datasets/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ def _prepare_single_hop_path_and_storage_options(
Storage options are formatted in the form {protocol: storage_options_for_protocol}
"""
token = None if download_config is None else download_config.token
if urlpath.startswith(config.HF_ENDPOINT) and "/resolve/" in urlpath:
if urlpath.startswith(config.HF_ENDPOINT):
urlpath = "hf://" + urlpath[len(config.HF_ENDPOINT) + 1 :].replace("/resolve/", "@", 1)
protocol = urlpath.split("://")[0] if "://" in urlpath else "file"
if download_config is not None and protocol in download_config.storage_options:
Expand Down

0 comments on commit a337212

Please sign in to comment.