Skip to content

Commit

Permalink
Fix for HTTP storage_options without 'headers'
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Jul 24, 2024
1 parent 85aa4d0 commit 11f56e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/datasets/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,8 @@ def _prepare_single_hop_path_and_storage_options(
urlpath += "&confirm=t"
if urlpath.startswith("https://raw.githubusercontent.com/"):
# Workaround for served data with gzip content-encoding: https://github.com/fsspec/filesystem_spec/issues/389
storage_options[protocol]["headers"]["Accept-Encoding"] = "identity"
headers = storage_options[protocol].setdefault("headers", {})
headers["Accept-Encoding"] = "identity"
elif protocol == "hf":
storage_options[protocol] = {
"token": token,
Expand Down

0 comments on commit 11f56e4

Please sign in to comment.