ndupuis commited on
Commit
52ab52b
·
verified ·
1 Parent(s): 5f7b206

Convert dataset to Parquet (#4)

Browse files

- Convert dataset to Parquet (1168025132af22e09ba1d778bdca8396f3e155e6)
- Delete loading script (7eb210fa0afa4ee356e8809a871ba1a6521cb0c5)

data/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6ef2b6e576cc66a77ddd4ac6b9bb39bd3cfb5f50baad1bcd414931e2b28d64d
3
+ size 62547
qiskit_humaneval.py DELETED
@@ -1,94 +0,0 @@
1
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- """ qiskit_humaneval dataset"""
15
-
16
- import json
17
- import datasets
18
- import os
19
- import requests
20
- logger = datasets.logging.get_logger(__name__)
21
-
22
-
23
- _CITATION = """\
24
- @misc{2406.14712,
25
- Author = {Sanjay Vishwakarma and Francis Harkins and Siddharth Golecha and Vishal Sharathchandra Bajpe and Nicolas Dupuis and Luca Buratti and David Kremer and Ismael Faro and Ruchir Puri and Juan Cruz-Benito},
26
- Title = {Qiskit HumanEval: An Evaluation Benchmark For Quantum Code Generative Models},
27
- Year = {2024},
28
- Eprint = {arXiv:2406.14712},
29
- }
30
- """
31
-
32
- _DESCRIPTION = """\
33
- qiskit_humaneval is a dataset for evaluating LLM's at writing Qiskit code.
34
- """
35
-
36
- _HOMEPAGE = "https://github.com/qiskit-community/qiskit-human-eval"
37
-
38
- _LICENSE = "apache-2.0"
39
-
40
- _URL = "https://raw.githubusercontent.com/qiskit-community/qiskit-human-eval/"\
41
- "refs/heads/main/dataset/dataset_qiskit_test_human_eval.json"
42
-
43
- class QiskitHumanEval(datasets.GeneratorBasedBuilder):
44
- """ qiskit_humaneval dataset
45
-
46
- 0.1.2: update to support Qiskit 2.0
47
- 0.1.1: update to support Qiskit 1.4 and improve test cases
48
- 0.1.0: first version of the dataset
49
- """
50
-
51
- VERSION = datasets.Version("0.1.2")
52
-
53
- def _info(self):
54
- features = datasets.Features(
55
- {
56
- 'task_id': datasets.Value('string'),
57
- 'prompt': datasets.Value('string'),
58
- 'canonical_solution': datasets.Value('string'),
59
- 'test': datasets.Value('string'),
60
- 'entry_point': datasets.Value('string'),
61
- 'difficulty_scale': datasets.Value('string')
62
- }
63
- )
64
- return datasets.DatasetInfo(
65
- description=_DESCRIPTION,
66
- features=features,
67
- homepage=_HOMEPAGE,
68
- license=_LICENSE,
69
- citation=_CITATION,
70
- )
71
-
72
- def _split_generators(self, dl_manager: datasets.DownloadManager):
73
- filepath = dl_manager.download_and_extract(_URL)
74
- return [
75
- datasets.SplitGenerator(
76
- name=datasets.Split.TEST,
77
- gen_kwargs={
78
- "filepath": filepath,
79
- },
80
- ),
81
- ]
82
-
83
- def _generate_examples(self, filepath):
84
- with open(filepath, 'r', encoding="UTF-8") as in_json:
85
- for row in json.load(in_json):
86
- id_ = row['task_id']
87
- yield id_, {
88
- 'task_id': row['task_id'],
89
- 'prompt': row['prompt'],
90
- 'canonical_solution': row['canonical_solution'],
91
- 'test': row['test'],
92
- 'entry_point': row['entry_point'],
93
- 'difficulty_scale': row['difficulty_scale']
94
- }