Datasets:
Tasks:
Text Retrieval
Modalities:
Text
Sub-tasks:
document-retrieval
Languages:
code
Size:
100K - 1M
ArXiv:
License:
fix _URLs
Browse files- repobench-r.py +15 -16
repobench-r.py
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
"""RepoBench: Benchmarking Repository-Level Code Auto-Completion Systems"""
|
16 |
|
17 |
import gzip
|
18 |
-
import
|
19 |
import textwrap
|
20 |
import datasets
|
21 |
|
@@ -56,20 +56,20 @@ _LICENSE = "Apache License 2.0"
|
|
56 |
# "python-cfr": "https://drive.google.com/file/d/1Bg_NQ00m0KCZ6KAtJ3v0cpzsWLj0HwKN/view?usp=drive_link"
|
57 |
# }
|
58 |
|
59 |
-
# _URLs = {
|
60 |
-
# "java-cff": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/data/java_cff.gz",
|
61 |
-
# "java-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/data/java_cfr.gz",
|
62 |
-
# "python-cff": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/data/python_cff.gz",
|
63 |
-
# "python-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/data/python_cfr.gz"
|
64 |
-
# }
|
65 |
-
|
66 |
_URLs = {
|
67 |
-
"java-cff": "https://huggingface.co/datasets/tianyang/repobench-r/
|
68 |
-
"java-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/
|
69 |
-
"python-cff": "https://huggingface.co/datasets/tianyang/repobench-r/
|
70 |
-
"python-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/
|
71 |
}
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
|
75 |
|
@@ -137,7 +137,7 @@ class RepoBenchR(datasets.GeneratorBasedBuilder):
|
|
137 |
def _split_generators(self, dl_manager):
|
138 |
"""Returns SplitGenerators."""
|
139 |
config_urls = _URLs[self.config.name]
|
140 |
-
data_dir = dl_manager.
|
141 |
|
142 |
return [
|
143 |
datasets.SplitGenerator(
|
@@ -160,9 +160,8 @@ class RepoBenchR(datasets.GeneratorBasedBuilder):
|
|
160 |
|
161 |
def _generate_examples(self, data_dir, split):
|
162 |
""" Yields examples. """
|
163 |
-
|
164 |
-
|
165 |
-
data = json.load(f)
|
166 |
|
167 |
subset, level = split.split("_")
|
168 |
for i, example in enumerate(data[subset][level]):
|
|
|
15 |
"""RepoBench: Benchmarking Repository-Level Code Auto-Completion Systems"""
|
16 |
|
17 |
import gzip
|
18 |
+
import pickle
|
19 |
import textwrap
|
20 |
import datasets
|
21 |
|
|
|
56 |
# "python-cfr": "https://drive.google.com/file/d/1Bg_NQ00m0KCZ6KAtJ3v0cpzsWLj0HwKN/view?usp=drive_link"
|
57 |
# }
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
_URLs = {
|
60 |
+
"java-cff": "https://huggingface.co/datasets/tianyang/repobench-r/resolve/main/data/java_cff.gz",
|
61 |
+
"java-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/resolve/main/data/java_cfr.gz",
|
62 |
+
"python-cff": "https://huggingface.co/datasets/tianyang/repobench-r/resolve/main/data/python_cff.gz",
|
63 |
+
"python-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/resolve/main/data/python_cfr.gz"
|
64 |
}
|
65 |
|
66 |
+
# _URLs = {
|
67 |
+
# "java-cff": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/json_data/java_cff.json.gz",
|
68 |
+
# "java-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/json_data/java_cfr.json.gz",
|
69 |
+
# "python-cff": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/json_data/python_cff.json.gz",
|
70 |
+
# "python-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/json_data/python_cfr.json.gz"
|
71 |
+
# }
|
72 |
+
|
73 |
|
74 |
|
75 |
|
|
|
137 |
def _split_generators(self, dl_manager):
|
138 |
"""Returns SplitGenerators."""
|
139 |
config_urls = _URLs[self.config.name]
|
140 |
+
data_dir = dl_manager.download(config_urls)
|
141 |
|
142 |
return [
|
143 |
datasets.SplitGenerator(
|
|
|
160 |
|
161 |
def _generate_examples(self, data_dir, split):
|
162 |
""" Yields examples. """
|
163 |
+
with gzip.open(data_dir, "rb") as f:
|
164 |
+
data = pickle.load(f)
|
|
|
165 |
|
166 |
subset, level = split.split("_")
|
167 |
for i, example in enumerate(data[subset][level]):
|