Datasets:
change back
Browse files- repobench-p.py +16 -35
repobench-p.py
CHANGED
@@ -70,40 +70,22 @@ class RepoBenchP(datasets.GeneratorBasedBuilder):
|
|
70 |
)
|
71 |
]
|
72 |
|
73 |
-
DEFAULT_SPLIT_NAME = "cff"
|
74 |
-
|
75 |
def _info(self):
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
"
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
else:
|
92 |
-
features = datasets.Features(
|
93 |
-
{
|
94 |
-
"repo_name": datasets.Value("string"),
|
95 |
-
"file_path": datasets.Value("string"),
|
96 |
-
"context": datasets.Sequence(feature={
|
97 |
-
"path": datasets.Value("string"),
|
98 |
-
"identifier": datasets.Value("string"),
|
99 |
-
"snippet": datasets.Value("string")
|
100 |
-
}),
|
101 |
-
"import_statement": datasets.Value("string"),
|
102 |
-
"code": datasets.Value("string"),
|
103 |
-
"next_line": datasets.Value("string"),
|
104 |
-
"gold_snippet_index": datasets.Value("int32")
|
105 |
-
}
|
106 |
-
)
|
107 |
|
108 |
return datasets.DatasetInfo(
|
109 |
description=_DESCRIPTION,
|
@@ -143,8 +125,7 @@ class RepoBenchP(datasets.GeneratorBasedBuilder):
|
|
143 |
with gzip.open(data_dir[split], "rb") as f:
|
144 |
data = pickle.load(f)
|
145 |
|
146 |
-
|
147 |
-
|
148 |
for i, example in enumerate(data):
|
149 |
|
150 |
yield i, example
|
|
|
70 |
)
|
71 |
]
|
72 |
|
|
|
|
|
73 |
def _info(self):
|
74 |
+
features = datasets.Features(
|
75 |
+
{
|
76 |
+
"repo_name": datasets.Value("string"),
|
77 |
+
"file_path": datasets.Value("string"),
|
78 |
+
"context": datasets.Sequence(feature={
|
79 |
+
"path": datasets.Value("string"),
|
80 |
+
"identifier": datasets.Value("string"),
|
81 |
+
"snippet": datasets.Value("string")
|
82 |
+
}),
|
83 |
+
"import_statement": datasets.Value("string"),
|
84 |
+
"code": datasets.Value("string"),
|
85 |
+
"next_line": datasets.Value("string"),
|
86 |
+
"gold_snippet_index": datasets.Value("int32"),
|
87 |
+
}
|
88 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
|
90 |
return datasets.DatasetInfo(
|
91 |
description=_DESCRIPTION,
|
|
|
125 |
with gzip.open(data_dir[split], "rb") as f:
|
126 |
data = pickle.load(f)
|
127 |
|
128 |
+
|
|
|
129 |
for i, example in enumerate(data):
|
130 |
|
131 |
yield i, example
|