Commit
·
18ffa24
1
Parent(s):
75bd244
Rename humaneval-x-bugs.py to humanevalpack.py
Browse files
humaneval-x-bugs.py → humanevalpack.py
RENAMED
|
@@ -1,32 +1,15 @@
|
|
| 1 |
-
# coding=utf-8
|
| 2 |
-
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
|
| 3 |
-
#
|
| 4 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
| 5 |
-
# you may not use this file except in compliance with the License.
|
| 6 |
-
# You may obtain a copy of the License at
|
| 7 |
-
#
|
| 8 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
| 9 |
-
#
|
| 10 |
-
# Unless required by applicable law or agreed to in writing, software
|
| 11 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 12 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 13 |
-
# See the License for the specific language governing permissions and
|
| 14 |
-
# limitations under the License.
|
| 15 |
-
"""HumanEval-X-Bugs dataset."""
|
| 16 |
-
|
| 17 |
-
|
| 18 |
import json
|
| 19 |
-
import datasets
|
| 20 |
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
_DESCRIPTION = """
|
| 24 |
"""
|
| 25 |
|
| 26 |
-
_HOMEPAGE = "https://github.com/bigcode-project/
|
| 27 |
|
| 28 |
def get_url(name):
|
| 29 |
-
url = f"data/{name}/data/
|
| 30 |
return url
|
| 31 |
|
| 32 |
def split_generator(dl_manager, name):
|
|
@@ -40,7 +23,7 @@ def split_generator(dl_manager, name):
|
|
| 40 |
)
|
| 41 |
]
|
| 42 |
|
| 43 |
-
class
|
| 44 |
"""BuilderConfig """
|
| 45 |
|
| 46 |
def __init__(self, name, description, features, **kwargs):
|
|
@@ -50,47 +33,47 @@ class HumanEvalXBugsConfig(datasets.BuilderConfig):
|
|
| 50 |
self.features = features
|
| 51 |
|
| 52 |
|
| 53 |
-
class
|
| 54 |
VERSION = datasets.Version("1.0.0")
|
| 55 |
BUILDER_CONFIGS = [
|
| 56 |
-
|
| 57 |
name="python",
|
| 58 |
-
description="Python
|
| 59 |
features=[
|
| 60 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 61 |
]
|
| 62 |
),
|
| 63 |
-
|
| 64 |
-
name="
|
| 65 |
-
description="
|
| 66 |
features=[
|
| 67 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 68 |
]
|
| 69 |
-
),
|
| 70 |
-
|
| 71 |
-
name="
|
| 72 |
-
description="
|
| 73 |
features=[
|
| 74 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 75 |
]
|
| 76 |
),
|
| 77 |
-
|
| 78 |
-
name="
|
| 79 |
-
description="
|
| 80 |
features=[
|
| 81 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 82 |
]
|
| 83 |
-
),
|
| 84 |
-
|
| 85 |
-
name="
|
| 86 |
-
description="
|
| 87 |
features=[
|
| 88 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 89 |
]
|
| 90 |
-
),
|
| 91 |
-
|
| 92 |
name="rust",
|
| 93 |
-
description="
|
| 94 |
features=[
|
| 95 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 96 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import json
|
|
|
|
| 2 |
|
| 3 |
+
import datasets
|
| 4 |
|
| 5 |
|
| 6 |
_DESCRIPTION = """
|
| 7 |
"""
|
| 8 |
|
| 9 |
+
_HOMEPAGE = "https://github.com/bigcode-project/octopack"
|
| 10 |
|
| 11 |
def get_url(name):
|
| 12 |
+
url = f"data/{name}/data/humanevalpack.jsonl"
|
| 13 |
return url
|
| 14 |
|
| 15 |
def split_generator(dl_manager, name):
|
|
|
|
| 23 |
)
|
| 24 |
]
|
| 25 |
|
| 26 |
+
class HumanEvalPackConfig(datasets.BuilderConfig):
|
| 27 |
"""BuilderConfig """
|
| 28 |
|
| 29 |
def __init__(self, name, description, features, **kwargs):
|
|
|
|
| 33 |
self.features = features
|
| 34 |
|
| 35 |
|
| 36 |
+
class HumanEvalPack(datasets.GeneratorBasedBuilder):
|
| 37 |
VERSION = datasets.Version("1.0.0")
|
| 38 |
BUILDER_CONFIGS = [
|
| 39 |
+
HumanEvalPackConfig(
|
| 40 |
name="python",
|
| 41 |
+
description="Python HumanEvalPack",
|
| 42 |
features=[
|
| 43 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 44 |
]
|
| 45 |
),
|
| 46 |
+
HumanEvalPackConfig(
|
| 47 |
+
name="js",
|
| 48 |
+
description="JavaScript HumanEvalPack",
|
| 49 |
features=[
|
| 50 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 51 |
]
|
| 52 |
+
),
|
| 53 |
+
HumanEvalPackConfig(
|
| 54 |
+
name="java",
|
| 55 |
+
description="Java HumanEvalPack",
|
| 56 |
features=[
|
| 57 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 58 |
]
|
| 59 |
),
|
| 60 |
+
HumanEvalPackConfig(
|
| 61 |
+
name="go",
|
| 62 |
+
description="Go HumanEvalPack",
|
| 63 |
features=[
|
| 64 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 65 |
]
|
| 66 |
+
),
|
| 67 |
+
HumanEvalPackConfig(
|
| 68 |
+
name="cpp",
|
| 69 |
+
description="C++ HumanEvalPack",
|
| 70 |
features=[
|
| 71 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 72 |
]
|
| 73 |
+
),
|
| 74 |
+
HumanEvalPackConfig(
|
| 75 |
name="rust",
|
| 76 |
+
description="Rust HumanEvalPack",
|
| 77 |
features=[
|
| 78 |
"task_id", "prompt", "import", "declaration", "buggy_solution", "canonical_solution", "test", "test_setup", "example_test", "bug_type", "failure_symptoms", "entry_point", "signature", "docstring", "instruction"
|
| 79 |
]
|