Datasets:

Languages:
code
ArXiv:
License:
kevmo314 commited on
Commit
2c29cd3
·
verified ·
1 Parent(s): 81d5ce0

fix: c# and f# config

Browse files

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.

Files changed (1) hide show
  1. commitpack.py +0 -7
commitpack.py CHANGED
@@ -37,10 +37,6 @@ CommitPack is is a 4TB dataset of commits scraped from GitHub repositories that
37
  URL = "https://huggingface.co/datasets/bigcode/commitpack/resolve/main/paths.json"
38
 
39
  _LANG = ["json", "xml", "text", "javascript", "objective-c++", "python", "c", "c++", "markdown", "java", "html", "yaml", "go", "csv", "php", "jupyter-notebook", "gettext-catalog", "sql", "unity3d-asset", "typescript", "web-ontology-language", "ruby", "c#", "nix", "shell", "perl", "tex", "css", "restructuredtext", "rust", "groff", "ini", "scala", "coffeescript", "haskell", "swift", "lua", "svg", "gas", "ocaml", "erlang", "makefile", "asciidoc", "emacs-lisp", "scss", "clojure", "org", "common-lisp", "diff", "groovy", "html+erb", "nesc", "dart", "powershell", "f#", "dm", "kotlin", "pascal", "jsx", "viml", "actionscript", "cython", "turtle", "less", "mathematica", "xslt", "scheme", "perl6", "edn", "fortran", "java-server-pages", "standard-ml", "cmake", "json5", "vala", "vue", "freemarker", "graphql", "twig", "tcl", "pod", "dockerfile", "yacc", "postscript", "racket", "eagle", "haxe", "julia", "handlebars", "smarty", "visual-basic", "literate-haskell", "smalltalk", "isabelle", "nimrod", "zig", "m4", "max", "elixir", "mako", "arduino", "jade", "haml", "elm", "purebasic", "coldfusion", "lean", "r", "cuda", "textile", "robotframework", "abap", "rdoc", "llvm", "ada", "batchfile", "qml", "jasmin", "assembly", "g-code", "cucumber", "html+php", "kicad", "api-blueprint", "eiffel", "toml", "modelica", "bitbake", "lex", "stylus", "protocol-buffer", "unknown", "nit", "factor", "xs", "sass", "parrot-internal-representation", "html+django", "mediawiki", "logos", "genshi", "coldfusion-cfc", "xtend", "sqf", "vhdl", "antlr", "systemverilog", "hcl", "asp", "nsis", "inform-7", "slim", "groovy-server-pages", "ceylon", "fish", "processing", "component-pascal", "lasso", "glsl", "saltstack", "xbase", "autohotkey", "liquid", "purescript", "agda", "inno-setup", "oz", "chapel", "arc", "opencl", "graphviz-dot", "pawn", "jsoniq", "bluespec", "smali", "krl", "maple", "unrealscript", "ooc", "pure-data", "xquery", "digital-command-language", "moonscript", "awk", "pike", "livescript", "solidity", "monkey", "jsonld", "zephir", "crystal", "rhtml", "stata", "idris", "raml", "openscad", "red", "c2hs-haskell", "cycript", "applescript", "mupad", "literate-agda", "boo", "sourcepawn", "qmake", "ragel-in-ruby-host", "io", "desktop", "propeller-spin", "thrift", "volt", "xproc", "igor-pro", "lolcode", "html+eex", "logtalk", "mirah", "gnuplot", "literate-coffeescript", "jflex", "emberscript", "cobol", "yang", "rebol", "linker-script", "cartocss", "urweb", "rmarkdown", "darcs-patch", "csound", "squirrel", "apl", "hlsl", "latte", "pony", "ioke", "hy", "uno", "pan", "xojo", "papyrus", "stan", "slash", "supercollider", "vcl", "smt", "glyph", "wisp", "renpy", "clips", "dns-zone", "sas", "rouge", "ec", "dylan", "tcsh", "aspectj", "netlogo", "gap", "fancy", "coq", "click", "capn-proto", "flux", "forth", "ats", "netlinx", "clean", "parrot-assembly", "alloy", "lfe", "gdscript", "augeas", "sparql", "lilypond", "scilab", "autoit", "myghty", "blitzmax", "creole", "harbour", "piglatin", "opa", "sage", "ston", "maxscript", "lsl", "gentoo-ebuild", "nu", "bro", "xc", "j", "metal", "module-management-system", "webidl", "tea", "redcode", "shen", "pov-ray-sdl", "x10", "brainfuck", "ninja", "golo", "webassembly", "self", "labview", "octave", "pogoscript", "d", "http", "ecl", "chuck", "gosu", "parrot", "opal", "objective-j", "kit", "gams", "prolog", "clarion", "mask", "brightscript", "scaml", "matlab", "idl", "ags-script", "lookml", "apacheconf", "oxygene", "txl", "grammatical-framework", "renderscript", "mtml", "unified-parallel-c", "dogescript", "gentoo-eclass", "zimpl", "irc-log", "fantom", "numpy", "cirru", "xpages", "nginx", "objdump", "python-traceback", "realbasic", "befunge", "bison", "m", "omgrofl"]
40
- _LANG_TO_URL_ESCAPE = {
41
- "c#": "c%23",
42
- "f#": "f%23",
43
- }
44
  _LICENSE = "Apache License 2.0"
45
  _VERSION = datasets.Version("1.0.0", "")
46
 
@@ -84,9 +80,6 @@ class CommitPack(datasets.GeneratorBasedBuilder):
84
  with open(path_file, "r") as f:
85
  files = json.load(f)[self.config.name]
86
 
87
- if self.config.name in _LANG_TO_URL_ESCAPE:
88
- files = [f.replace("#", "%23") for f in files]
89
-
90
  downloaded_files = dl_manager.download(files)
91
  return [
92
  datasets.SplitGenerator(
 
37
  URL = "https://huggingface.co/datasets/bigcode/commitpack/resolve/main/paths.json"
38
 
39
  _LANG = ["json", "xml", "text", "javascript", "objective-c++", "python", "c", "c++", "markdown", "java", "html", "yaml", "go", "csv", "php", "jupyter-notebook", "gettext-catalog", "sql", "unity3d-asset", "typescript", "web-ontology-language", "ruby", "c#", "nix", "shell", "perl", "tex", "css", "restructuredtext", "rust", "groff", "ini", "scala", "coffeescript", "haskell", "swift", "lua", "svg", "gas", "ocaml", "erlang", "makefile", "asciidoc", "emacs-lisp", "scss", "clojure", "org", "common-lisp", "diff", "groovy", "html+erb", "nesc", "dart", "powershell", "f#", "dm", "kotlin", "pascal", "jsx", "viml", "actionscript", "cython", "turtle", "less", "mathematica", "xslt", "scheme", "perl6", "edn", "fortran", "java-server-pages", "standard-ml", "cmake", "json5", "vala", "vue", "freemarker", "graphql", "twig", "tcl", "pod", "dockerfile", "yacc", "postscript", "racket", "eagle", "haxe", "julia", "handlebars", "smarty", "visual-basic", "literate-haskell", "smalltalk", "isabelle", "nimrod", "zig", "m4", "max", "elixir", "mako", "arduino", "jade", "haml", "elm", "purebasic", "coldfusion", "lean", "r", "cuda", "textile", "robotframework", "abap", "rdoc", "llvm", "ada", "batchfile", "qml", "jasmin", "assembly", "g-code", "cucumber", "html+php", "kicad", "api-blueprint", "eiffel", "toml", "modelica", "bitbake", "lex", "stylus", "protocol-buffer", "unknown", "nit", "factor", "xs", "sass", "parrot-internal-representation", "html+django", "mediawiki", "logos", "genshi", "coldfusion-cfc", "xtend", "sqf", "vhdl", "antlr", "systemverilog", "hcl", "asp", "nsis", "inform-7", "slim", "groovy-server-pages", "ceylon", "fish", "processing", "component-pascal", "lasso", "glsl", "saltstack", "xbase", "autohotkey", "liquid", "purescript", "agda", "inno-setup", "oz", "chapel", "arc", "opencl", "graphviz-dot", "pawn", "jsoniq", "bluespec", "smali", "krl", "maple", "unrealscript", "ooc", "pure-data", "xquery", "digital-command-language", "moonscript", "awk", "pike", "livescript", "solidity", "monkey", "jsonld", "zephir", "crystal", "rhtml", "stata", "idris", "raml", "openscad", "red", "c2hs-haskell", "cycript", "applescript", "mupad", "literate-agda", "boo", "sourcepawn", "qmake", "ragel-in-ruby-host", "io", "desktop", "propeller-spin", "thrift", "volt", "xproc", "igor-pro", "lolcode", "html+eex", "logtalk", "mirah", "gnuplot", "literate-coffeescript", "jflex", "emberscript", "cobol", "yang", "rebol", "linker-script", "cartocss", "urweb", "rmarkdown", "darcs-patch", "csound", "squirrel", "apl", "hlsl", "latte", "pony", "ioke", "hy", "uno", "pan", "xojo", "papyrus", "stan", "slash", "supercollider", "vcl", "smt", "glyph", "wisp", "renpy", "clips", "dns-zone", "sas", "rouge", "ec", "dylan", "tcsh", "aspectj", "netlogo", "gap", "fancy", "coq", "click", "capn-proto", "flux", "forth", "ats", "netlinx", "clean", "parrot-assembly", "alloy", "lfe", "gdscript", "augeas", "sparql", "lilypond", "scilab", "autoit", "myghty", "blitzmax", "creole", "harbour", "piglatin", "opa", "sage", "ston", "maxscript", "lsl", "gentoo-ebuild", "nu", "bro", "xc", "j", "metal", "module-management-system", "webidl", "tea", "redcode", "shen", "pov-ray-sdl", "x10", "brainfuck", "ninja", "golo", "webassembly", "self", "labview", "octave", "pogoscript", "d", "http", "ecl", "chuck", "gosu", "parrot", "opal", "objective-j", "kit", "gams", "prolog", "clarion", "mask", "brightscript", "scaml", "matlab", "idl", "ags-script", "lookml", "apacheconf", "oxygene", "txl", "grammatical-framework", "renderscript", "mtml", "unified-parallel-c", "dogescript", "gentoo-eclass", "zimpl", "irc-log", "fantom", "numpy", "cirru", "xpages", "nginx", "objdump", "python-traceback", "realbasic", "befunge", "bison", "m", "omgrofl"]
 
 
 
 
40
  _LICENSE = "Apache License 2.0"
41
  _VERSION = datasets.Version("1.0.0", "")
42
 
 
80
  with open(path_file, "r") as f:
81
  files = json.load(f)[self.config.name]
82
 
 
 
 
83
  downloaded_files = dl_manager.download(files)
84
  return [
85
  datasets.SplitGenerator(