Datasets:

Languages:
code
ArXiv:
License:

fix: c# and f# config

#3
by kevmo314 - opened

Addresses the following error:

>>> from datasets import load_dataset
>>> ds = load_dataset("bigcode/commitpack", "f#", split="train", streaming=True)
>>> for x in ds:
...   print(x)
... 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ...
  File "/home/ubuntu/.cache/huggingface/modules/datasets_modules/datasets/bigcode--commitpack/10971f6f496f32bb1bdcf021696247550e247807d2183dc00f7be9aa2d4cef2a/commitpack.py", line 104, in _generate_examples
    with open(p, "r") as f:
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/datasets/streaming.py", line 75, in wrapper
    return function(*args, download_config=download_config, **kwargs)
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/datasets/utils/file_utils.py", line 948, in xopen
    file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open()
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/fsspec/core.py", line 147, in open
    return self.__enter__()
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/fsspec/core.py", line 105, in __enter__
    f = self.fs.open(self.path, mode=mode)
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/fsspec/spec.py", line 1303, in open
    f = self._open(
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 275, in _open
    return HfFileSystemFile(self, path, mode=mode, revision=revision, block_size=block_size, **kwargs)
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 947, in __init__
    self.details = fs.info(self.resolved_path.unresolve(), expand_info=False)
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 711, in info
    self.ls(parent_path, expand_info=False)
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 380, in ls
    _raise_file_not_found(path, None)
  File "/home/ubuntu/.../server/venv/lib/python3.10/site-packages/huggingface_hub/hf_file_system.py", line 1136, in _raise_file_not_found
    raise FileNotFoundError(msg) from err
FileNotFoundError: datasets/bigcode/commitpack@81d5ce0c103d9fe05879b50949ed41c40b96de69/data/f%23

I'm not sure what the original intent for escaping the url was since they seem to be escaped correctly by datasets, but removing this transformation fixes the issue.

BigCode org

Nice; I think for an older version of datasets this was needed

Muennighoff changed pull request status to merged

Sign up or log in to comment