Datasets:
Tasks:
Text Retrieval
Modalities:
Text
Sub-tasks:
document-retrieval
Languages:
code
Size:
100K - 1M
ArXiv:
License:
use json.gz instead
Browse files- json_data/java_cff.json.gz +3 -0
- json_data/java_cfr.json.gz +3 -0
- json_data/python_cff.json.gz +3 -0
- json_data/python_cfr.json.gz +3 -0
- repobench-r.py +18 -8
json_data/java_cff.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fc3013a1ef62a979e2434baa948851dac8e30d8fef771778302d16acb812b2a5
|
3 |
+
size 648564197
|
json_data/java_cfr.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:39d3d6d2ac2cb0802c024aab9bb2fb7092f81e8fbda5f6632de6bb3b40e830dc
|
3 |
+
size 361247185
|
json_data/python_cff.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3db3db9683bbd19e37e4298136c912a6738bdadb2ffcd64b7f8c78bfa644e0fa
|
3 |
+
size 451759519
|
json_data/python_cfr.json.gz
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ed6dbc096f7d63758f9284aa9ae181821aef99a978b470a27bc833b3afabd331
|
3 |
+
size 226527449
|
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,15 +56,24 @@ _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/
|
61 |
-
"java-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/
|
62 |
-
"python-cff": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/
|
63 |
-
"python-cfr": "https://huggingface.co/datasets/tianyang/repobench-r/blob/main/
|
64 |
}
|
65 |
|
66 |
|
67 |
|
|
|
|
|
68 |
class RepoBenchR(datasets.GeneratorBasedBuilder):
|
69 |
"""RepoBench"""
|
70 |
|
@@ -128,7 +137,7 @@ class RepoBenchR(datasets.GeneratorBasedBuilder):
|
|
128 |
def _split_generators(self, dl_manager):
|
129 |
"""Returns SplitGenerators."""
|
130 |
config_urls = _URLs[self.config.name]
|
131 |
-
data_dir = dl_manager.
|
132 |
|
133 |
return [
|
134 |
datasets.SplitGenerator(
|
@@ -151,8 +160,9 @@ class RepoBenchR(datasets.GeneratorBasedBuilder):
|
|
151 |
|
152 |
def _generate_examples(self, data_dir, split):
|
153 |
""" Yields examples. """
|
154 |
-
|
155 |
-
|
|
|
156 |
|
157 |
subset, level = split.split("_")
|
158 |
for i, example in enumerate(data[subset][level]):
|
|
|
15 |
"""RepoBench: Benchmarking Repository-Level Code Auto-Completion Systems"""
|
16 |
|
17 |
import gzip
|
18 |
+
import json
|
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/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/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 |
+
|
76 |
+
|
77 |
class RepoBenchR(datasets.GeneratorBasedBuilder):
|
78 |
"""RepoBench"""
|
79 |
|
|
|
137 |
def _split_generators(self, dl_manager):
|
138 |
"""Returns SplitGenerators."""
|
139 |
config_urls = _URLs[self.config.name]
|
140 |
+
data_dir = dl_manager.download_and_extract(config_urls)
|
141 |
|
142 |
return [
|
143 |
datasets.SplitGenerator(
|
|
|
160 |
|
161 |
def _generate_examples(self, data_dir, split):
|
162 |
""" Yields examples. """
|
163 |
+
|
164 |
+
with open(data_dir, encoding="utf-8") as f:
|
165 |
+
data = json.load(f)
|
166 |
|
167 |
subset, level = split.split("_")
|
168 |
for i, example in enumerate(data[subset][level]):
|