Convert dataset to Parquet
#12
by arjunguha - opened
Files changed (14)
- README.md+255
- cpp/test-00000-of-00001.parquetAdded+3
- data/cpp/data/humanevalpack.jsonlDeleted
- data/go/data/humanevalpack.jsonlDeleted
- data/java/data/humanevalpack.jsonlDeleted
- data/js/data/humanevalpack.jsonlDeleted
- data/python/data/humanevalpack.jsonlDeleted
- data/rust/data/humanevalpack.jsonlDeleted
- go/test-00000-of-00001.parquetAdded+3
- humanevalpack.pyDeleted-151
- java/test-00000-of-00001.parquetAdded+3
- js/test-00000-of-00001.parquetAdded+3
- python/test-00000-of-00001.parquetAdded+3
- rust/test-00000-of-00001.parquetAdded+3
8 unmodified lines910111213148 unmodified lines- codetags:- code---8 unmodified lines91011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682698 unmodified lines- codetags:- codedataset_info:- config_name: cppfeatures:- name: task_iddtype: string- name: promptdtype: string- name: declarationdtype: string- name: canonical_solutiondtype: string- name: buggy_solutiondtype: string- name: bug_typedtype: string- name: failure_symptomsdtype: string- name: entry_pointdtype: string- name: importdtype: string- name: test_setupdtype: string- name: testdtype: string- name: example_testdtype: string- name: signaturedtype: string- name: docstringdtype: string- name: instructiondtype: stringsplits:- name: testnum_bytes: 469111num_examples: 164download_size: 193981dataset_size: 469111- config_name: gofeatures:- name: task_iddtype: string- name: promptdtype: string- name: declarationdtype: string- name: canonical_solutiondtype: string- name: buggy_solutiondtype: string- name: bug_typedtype: string- name: failure_symptomsdtype: string- name: entry_pointdtype: string- name: importdtype: string- name: test_setupdtype: string- name: testdtype: string- name: example_testdtype: string- name: signaturedtype: string- name: docstringdtype: string- name: instructiondtype: stringsplits:- name: testnum_bytes: 463234num_examples: 164download_size: 198394dataset_size: 463234- config_name: javafeatures:- name: task_iddtype: string- name: promptdtype: string- name: declarationdtype: string- name: canonical_solutiondtype: string- name: buggy_solutiondtype: string- name: bug_typedtype: string- name: failure_symptomsdtype: string- name: entry_pointdtype: string- name: importdtype: string- name: test_setupdtype: string- name: testdtype: string- name: example_testdtype: string- name: signaturedtype: string- name: docstringdtype: string- name: instructiondtype: stringsplits:- name: testnum_bytes: 589440num_examples: 164download_size: 210440dataset_size: 589440- config_name: jsfeatures:- name: task_iddtype: string- name: promptdtype: string- name: declarationdtype: string- name: canonical_solutiondtype: string- name: buggy_solutiondtype: string- name: bug_typedtype: string- name: failure_symptomsdtype: string- name: entry_pointdtype: string- name: importdtype: string- name: test_setupdtype: string- name: testdtype: string- name: example_testdtype: string- name: signaturedtype: string- name: docstringdtype: string- name: instructiondtype: stringsplits:- name: testnum_bytes: 435189num_examples: 164download_size: 194044dataset_size: 435189- config_name: pythonfeatures:- name: task_iddtype: string- name: promptdtype: string- name: declarationdtype: string- name: canonical_solutiondtype: string- name: buggy_solutiondtype: string- name: bug_typedtype: string- name: failure_symptomsdtype: string- name: entry_pointdtype: string- name: importdtype: string- name: test_setupdtype: string- name: testdtype: string- name: example_testdtype: string- name: signaturedtype: string- name: docstringdtype: string- name: instructiondtype: stringsplits:- name: testnum_bytes: 423013num_examples: 164download_size: 191279dataset_size: 423013- config_name: rustfeatures:- name: task_iddtype: string- name: promptdtype: string- name: declarationdtype: string- name: canonical_solutiondtype: string- name: buggy_solutiondtype: string- name: bug_typedtype: string- name: failure_symptomsdtype: string- name: entry_pointdtype: string- name: importdtype: string- name: test_setupdtype: string- name: testdtype: string- name: example_testdtype: string- name: signaturedtype: string- name: docstringdtype: string- name: instructiondtype: stringsplits:- name: testnum_bytes: 450539num_examples: 164download_size: 168464dataset_size: 450539configs:- config_name: cppdata_files:- split: testpath: cpp/test-*- config_name: godata_files:- split: testpath: go/test-*- config_name: javadata_files:- split: testpath: java/test-*- config_name: jsdata_files:- split: testpath: js/test-*- config_name: pythondata_files:- split: testpath: python/test-*default: true- config_name: rustdata_files:- split: testpath: rust/test-*---
123version https://git-lfs.github.com/spec/v1oid sha256:fd2eed15063bf883952fb3b0a23a372eeaa9b9e58932a496667a0c2595145779size 193981123version https://git-lfs.github.com/spec/v1oid sha256:5cbb0e8152b5c9d2b595a1fa9d540c87cde7a306e9fc7f63febe24825bc20c74size 198394123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151import json
import datasets
_DESCRIPTION = """"""
_HOMEPAGE = "https://github.com/bigcode-project/octopack"
def get_url(name): url = f"data/{name}/data/humanevalpack.jsonl" return url
def split_generator(dl_manager, name): downloaded_files = dl_manager.download(get_url(name)) return [ datasets.SplitGenerator( name=datasets.Split.TEST, gen_kwargs={ "filepath": downloaded_files, }, ) ]
class HumanEvalPackConfig(datasets.BuilderConfig): """BuilderConfig """
def __init__(self, name, description, features, **kwargs): super(HumanEvalPackConfig, self).__init__(version=datasets.Version("1.0.0", ""), **kwargs) self.name = name self.description = description self.features = features
class HumanEvalPack(datasets.GeneratorBasedBuilder): VERSION = datasets.Version("1.0.0") BUILDER_CONFIGS = [ HumanEvalPackConfig( name="python", description="Python HumanEvalPack", features=[ "task_id", "prompt", "declaration", "canonical_solution", "buggy_solution", "bug_type", "failure_symptoms", "import", "test_setup", "test", "example_test", "entry_point", "signature", "docstring", "instruction" ] ), HumanEvalPackConfig( name="js", description="JavaScript HumanEvalPack", features=[ "task_id", "prompt", "declaration", "canonical_solution", "buggy_solution", "bug_type", "failure_symptoms", "import", "test_setup", "test", "example_test", "entry_point", "signature", "docstring", "instruction" ] ), HumanEvalPackConfig( name="java", description="Java HumanEvalPack", features=[ "task_id", "prompt", "declaration", "canonical_solution", "buggy_solution", "bug_type", "failure_symptoms", "import", "test_setup", "test", "example_test", "entry_point", "signature", "docstring", "instruction" ] ), HumanEvalPackConfig( name="go", description="Go HumanEvalPack", features=[ "task_id", "prompt", "declaration", "canonical_solution", "buggy_solution", "bug_type", "failure_symptoms", "import", "test_setup", "test", "example_test", "entry_point", "signature", "docstring", "instruction" ] ), HumanEvalPackConfig( name="cpp", description="C++ HumanEvalPack", features=[ "task_id", "prompt", "declaration", "canonical_solution", "buggy_solution", "bug_type", "failure_symptoms", "import", "test_setup", "test", "example_test", "entry_point", "signature", "docstring", "instruction" ] ), HumanEvalPackConfig( name="rust", description="Rust HumanEvalPack", features=[ "task_id", "prompt", "declaration", "canonical_solution", "buggy_solution", "bug_type", "failure_symptoms", "import", "test_setup", "test", "example_test", "entry_point", "signature", "docstring", "instruction" ] ), ] DEFAULT_CONFIG_NAME = "python"
def _info(self): return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "task_id": datasets.Value("string"), "prompt": datasets.Value("string"), "declaration": datasets.Value("string"), "canonical_solution": datasets.Value("string"), "buggy_solution": datasets.Value("string"), "bug_type": datasets.Value("string"), "failure_symptoms": datasets.Value("string"), "entry_point": datasets.Value("string"), "import": datasets.Value("string"), "test_setup": datasets.Value("string"), "test": datasets.Value("string"), "example_test": datasets.Value("string"), "signature": datasets.Value("string"), "docstring": datasets.Value("string"), "instruction": datasets.Value("string"), } ), homepage=_HOMEPAGE, )
def _split_generators(self, dl_manager): if self.config.name == "python": return split_generator(dl_manager, self.config.name)
elif self.config.name == "cpp": return split_generator(dl_manager, self.config.name)
elif self.config.name == "go": return split_generator(dl_manager, self.config.name)
elif self.config.name == "java": return split_generator(dl_manager, self.config.name)
elif self.config.name == "js": return split_generator(dl_manager, self.config.name)
elif self.config.name == "rust": return split_generator(dl_manager, self.config.name) def _generate_examples(self, filepath): key = 0 with open(filepath) as f: for line in f: row = json.loads(line) key += 1 yield key, { "task_id": row["task_id"], "prompt": row["prompt"], "declaration": row["declaration"], "canonical_solution": row["canonical_solution"], "buggy_solution": row["buggy_solution"], "bug_type": row["bug_type"], "failure_symptoms": row["failure_symptoms"], "import": row.get("import", ""), # Only for Go "test_setup": row.get("test_setup", ""), # Only for Go "test": row["test"], "example_test": row["example_test"], "entry_point": row["entry_point"], "signature": row["signature"], "docstring": row["docstring"], "instruction": row["instruction"], } key += 1123version https://git-lfs.github.com/spec/v1oid sha256:0be942d715894e3b350149f1cde6593e95eda495aa4bd1750f09428c0b3e3e9csize 210440123version https://git-lfs.github.com/spec/v1oid sha256:52d6aada9ff62c22ba139aaa64431cca461fbca3cb0625521a988ffeef250855size 194044123version https://git-lfs.github.com/spec/v1oid sha256:ed5f15d789156e21222bfcd556c425a39042355c84ae1e8b058abd6a3d7f8075size 191279123version https://git-lfs.github.com/spec/v1oid sha256:02570ed6a11d8801d26a9aae0db87cdc0fc6f4a7eb68adb3a9e37fb4f752da57size 168464README.md+255
cpp/test-00000-of-00001.parquetAdded+3
data/cpp/data/humanevalpack.jsonlDeleted
data/go/data/humanevalpack.jsonlDeleted
data/java/data/humanevalpack.jsonlDeleted
data/js/data/humanevalpack.jsonlDeleted
data/python/data/humanevalpack.jsonlDeleted
data/rust/data/humanevalpack.jsonlDeleted
go/test-00000-of-00001.parquetAdded+3
humanevalpack.pyDeleted-151
java/test-00000-of-00001.parquetAdded+3
js/test-00000-of-00001.parquetAdded+3
python/test-00000-of-00001.parquetAdded+3
rust/test-00000-of-00001.parquetAdded+3