Convert dataset to Parquet (part 00004-of-00005)
#6
by LoMicha - opened
- train_real_simple_io.tar.gz → ExeBench/test_real-00000-of-00001.parquet +2 -2
- test_real.tar.gz → ExeBench/test_synth-00000-of-00001.parquet +2 -2
- test_synth.tar.gz → ExeBench/train_synth_rich_io-00008-of-00009.parquet +2 -2
- valid_real.tar.gz → ExeBench/valid_real-00000-of-00001.parquet +2 -2
- ExeBench/valid_synth-00000-of-00001.parquet +3 -0
- README.md +130 -0
- exebench.py +0 -223
- train_no_compilable.tar.gz +0 -3
- train_real_compilable.tar.gz +0 -3
- train_synth_compilable.tar.gz +0 -3
- train_synth_rich_io.tar.gz +0 -3
- train_synth_simple_io.tar.gz +0 -3
- valid_synth.tar.gz +0 -3
train_real_simple_io.tar.gz → ExeBench/test_real-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:151dcd2783232480dc8c202d91c95cf99dbba525039ece5ca7c4194b5fd5835b
|
| 3 |
+
size 18974256
|
test_real.tar.gz → ExeBench/test_synth-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:962e9ccb2a705c1728a8c3e211108962e2cb3614f401009699e58b0e655d56cf
|
| 3 |
+
size 33733873
|
test_synth.tar.gz → ExeBench/train_synth_rich_io-00008-of-00009.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:67fb35baf4d54e645212a93ae4c9c2a8dc4daf60d18896363b4f0292a815b8f1
|
| 3 |
+
size 77576785
|
valid_real.tar.gz → ExeBench/valid_real-00000-of-00001.parquet
RENAMED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc63d33157d76fed3e9a62ada37d0d251bd80951fc88352603acf5a6ea74038d
|
| 3 |
+
size 28423343
|
ExeBench/valid_synth-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bb13f5313bd38b62b18d9c734673e78c57679be5e7a863146f1e26fa9c1b3f48
|
| 3 |
+
size 35869868
|
README.md
CHANGED
|
@@ -1,3 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# ExeBench: an ML-scale dataset of executable C functions
|
| 2 |
|
| 3 |
ExeBench is a dataset of millions of C functions paired with dependencies and metadatada such that at least a subset of it can be executed with IO pairs. It is mainly inteded for machine learning applications but it is application-agnostic enough to have other usages.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
dataset_info:
|
| 3 |
+
config_name: ExeBench
|
| 4 |
+
features:
|
| 5 |
+
- name: path
|
| 6 |
+
dtype: string
|
| 7 |
+
- name: func_def
|
| 8 |
+
dtype: string
|
| 9 |
+
- name: func_head
|
| 10 |
+
dtype: string
|
| 11 |
+
- name: func_head_types
|
| 12 |
+
dtype: string
|
| 13 |
+
- name: fname
|
| 14 |
+
dtype: string
|
| 15 |
+
- name: signature
|
| 16 |
+
sequence: string
|
| 17 |
+
- name: asm
|
| 18 |
+
sequence:
|
| 19 |
+
- name: target
|
| 20 |
+
dtype: string
|
| 21 |
+
- name: code
|
| 22 |
+
dtype: string
|
| 23 |
+
- name: synth_deps
|
| 24 |
+
dtype: string
|
| 25 |
+
- name: real_deps
|
| 26 |
+
dtype: string
|
| 27 |
+
- name: synth_io_pairs
|
| 28 |
+
sequence:
|
| 29 |
+
- name: input
|
| 30 |
+
sequence:
|
| 31 |
+
- name: var
|
| 32 |
+
dtype: string
|
| 33 |
+
- name: value
|
| 34 |
+
dtype: string
|
| 35 |
+
- name: output
|
| 36 |
+
sequence:
|
| 37 |
+
- name: var
|
| 38 |
+
dtype: string
|
| 39 |
+
- name: value
|
| 40 |
+
dtype: string
|
| 41 |
+
- name: dummy_funcs
|
| 42 |
+
dtype: string
|
| 43 |
+
- name: dummy_funcs_seed
|
| 44 |
+
dtype: int64
|
| 45 |
+
- name: real_io_pairs
|
| 46 |
+
sequence:
|
| 47 |
+
- name: input
|
| 48 |
+
sequence:
|
| 49 |
+
- name: var
|
| 50 |
+
dtype: string
|
| 51 |
+
- name: value
|
| 52 |
+
dtype: string
|
| 53 |
+
- name: output
|
| 54 |
+
sequence:
|
| 55 |
+
- name: var
|
| 56 |
+
dtype: string
|
| 57 |
+
- name: value
|
| 58 |
+
dtype: string
|
| 59 |
+
- name: dummy_funcs
|
| 60 |
+
dtype: string
|
| 61 |
+
- name: dummy_funcs_seed
|
| 62 |
+
dtype: int64
|
| 63 |
+
- name: synth_exe_wrapper
|
| 64 |
+
dtype: string
|
| 65 |
+
- name: real_exe_wrapper
|
| 66 |
+
dtype: string
|
| 67 |
+
- name: ref
|
| 68 |
+
dtype: string
|
| 69 |
+
- name: synth_iospec
|
| 70 |
+
dtype: string
|
| 71 |
+
- name: real_iospec
|
| 72 |
+
dtype: string
|
| 73 |
+
splits:
|
| 74 |
+
- name: train_not_compilable
|
| 75 |
+
num_bytes: 2059245891
|
| 76 |
+
num_examples: 715700
|
| 77 |
+
- name: train_synth_compilable
|
| 78 |
+
num_bytes: 60287736644
|
| 79 |
+
num_examples: 4159373
|
| 80 |
+
- name: train_real_compilable
|
| 81 |
+
num_bytes: 11988407074
|
| 82 |
+
num_examples: 885074
|
| 83 |
+
- name: train_synth_simple_io
|
| 84 |
+
num_bytes: 20089650210
|
| 85 |
+
num_examples: 640116
|
| 86 |
+
- name: train_real_simple_io
|
| 87 |
+
num_bytes: 266865540
|
| 88 |
+
num_examples: 42769
|
| 89 |
+
- name: train_synth_rich_io
|
| 90 |
+
num_bytes: 4358613407
|
| 91 |
+
num_examples: 107250
|
| 92 |
+
- name: valid_synth
|
| 93 |
+
num_bytes: 207011272
|
| 94 |
+
num_examples: 5000
|
| 95 |
+
- name: valid_real
|
| 96 |
+
num_bytes: 55126948
|
| 97 |
+
num_examples: 2133
|
| 98 |
+
- name: test_synth
|
| 99 |
+
num_bytes: 192119154
|
| 100 |
+
num_examples: 5000
|
| 101 |
+
- name: test_real
|
| 102 |
+
num_bytes: 41191987
|
| 103 |
+
num_examples: 2134
|
| 104 |
+
download_size: 18777417895
|
| 105 |
+
dataset_size: 99545968127
|
| 106 |
+
configs:
|
| 107 |
+
- config_name: ExeBench
|
| 108 |
+
data_files:
|
| 109 |
+
- split: train_not_compilable
|
| 110 |
+
path: ExeBench/train_not_compilable-*
|
| 111 |
+
- split: train_synth_compilable
|
| 112 |
+
path: ExeBench/train_synth_compilable-*
|
| 113 |
+
- split: train_real_compilable
|
| 114 |
+
path: ExeBench/train_real_compilable-*
|
| 115 |
+
- split: train_synth_simple_io
|
| 116 |
+
path: ExeBench/train_synth_simple_io-*
|
| 117 |
+
- split: train_real_simple_io
|
| 118 |
+
path: ExeBench/train_real_simple_io-*
|
| 119 |
+
- split: train_synth_rich_io
|
| 120 |
+
path: ExeBench/train_synth_rich_io-*
|
| 121 |
+
- split: valid_synth
|
| 122 |
+
path: ExeBench/valid_synth-*
|
| 123 |
+
- split: valid_real
|
| 124 |
+
path: ExeBench/valid_real-*
|
| 125 |
+
- split: test_synth
|
| 126 |
+
path: ExeBench/test_synth-*
|
| 127 |
+
- split: test_real
|
| 128 |
+
path: ExeBench/test_real-*
|
| 129 |
+
default: true
|
| 130 |
+
---
|
| 131 |
# ExeBench: an ML-scale dataset of executable C functions
|
| 132 |
|
| 133 |
ExeBench is a dataset of millions of C functions paired with dependencies and metadatada such that at least a subset of it can be executed with IO pairs. It is mainly inteded for machine learning applications but it is application-agnostic enough to have other usages.
|
exebench.py
DELETED
|
@@ -1,223 +0,0 @@
|
|
| 1 |
-
# coding=utf-8
|
| 2 |
-
# Copyright 2022 ExeBench authors
|
| 3 |
-
# The code required to produce and load this dataset is licensed under MIT License.
|
| 4 |
-
# The code samples included in this dataset keep their own licenses, which can be retrieved via their metadata.
|
| 5 |
-
# Unless required by applicable law or agreed to in writing, software
|
| 6 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
| 7 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 8 |
-
# See the License for the specific language governing permissions and
|
| 9 |
-
# limitations under the License.
|
| 10 |
-
|
| 11 |
-
# Please note that the dataset release is still work in progress.
|
| 12 |
-
|
| 13 |
-
"""The ExeBench dataset."""
|
| 14 |
-
|
| 15 |
-
import json
|
| 16 |
-
|
| 17 |
-
import datasets
|
| 18 |
-
|
| 19 |
-
from pathlib import Path
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
_CITATION = """\
|
| 23 |
-
@inproceedings{10.1145/3520312.3534867,
|
| 24 |
-
author = {Armengol-Estap\'{e}, Jordi and Woodruff, Jackson and Brauckmann, Alexander and Magalh\~{a}es, Jos\'{e} Wesley de Souza and O'Boyle, Michael F. P.},
|
| 25 |
-
title = {ExeBench: An ML-Scale Dataset of Executable C Functions},
|
| 26 |
-
year = {2022},
|
| 27 |
-
isbn = {9781450392730},
|
| 28 |
-
publisher = {Association for Computing Machinery},
|
| 29 |
-
address = {New York, NY, USA},
|
| 30 |
-
url = {https://doi.org/10.1145/3520312.3534867},
|
| 31 |
-
doi = {10.1145/3520312.3534867},
|
| 32 |
-
abstract = {Machine-learning promises to transform compilation and software engineering, yet is frequently limited by the scope of available datasets. In particular, there is a lack of runnable, real-world datasets required for a range of tasks ranging from neural program synthesis to machine learning-guided program optimization. We introduce a new dataset, ExeBench, which attempts to address this. It tackles two key issues with real-world code: references to external types and functions and scalable generation of IO examples. ExeBench is the first publicly available dataset that pairs real-world C code taken from GitHub with IO examples that allow these programs to be run. We develop a toolchain that scrapes GitHub, analyzes the code, and generates runnable snippets of code. We analyze our benchmark suite using several metrics, and show it is representative of real-world code. ExeBench contains 4.5M compilable and 700k executable C functions. This scale of executable, real functions will enable the next generation of machine learning-based programming tasks.},
|
| 33 |
-
booktitle = {Proceedings of the 6th ACM SIGPLAN International Symposium on Machine Programming},
|
| 34 |
-
pages = {50–59},
|
| 35 |
-
numpages = {10},
|
| 36 |
-
keywords = {Code Dataset, Program Synthesis, Mining Software Repositories, C, Machine Learning for Code, Compilers},
|
| 37 |
-
location = {San Diego, CA, USA},
|
| 38 |
-
series = {MAPS 2022}
|
| 39 |
-
}
|
| 40 |
-
"""
|
| 41 |
-
|
| 42 |
-
_DESCRIPTION = """\
|
| 43 |
-
An ML-scale dataset of executable C functions
|
| 44 |
-
""" # TODO: expand
|
| 45 |
-
|
| 46 |
-
_HOMEPAGE = "https://github.com/jordiae/exebench"
|
| 47 |
-
|
| 48 |
-
_LICENSE = "Multiple: see each function license (fields 'ref' and 'path')"
|
| 49 |
-
|
| 50 |
-
_URL = "" # "https://huggingface.co/datasets/jordiae/exebench-test/resolve/main/"
|
| 51 |
-
|
| 52 |
-
_REMOVED_FEATURES = ["doc", "angha_error", "real_error", "angha_io_error", "real_io_error",
|
| 53 |
-
"angha_io_pairs_are_trivial", "real_io_pairs_are_trivial"]
|
| 54 |
-
|
| 55 |
-
_RENAMED_FEATURES = {"angha_deps": "synth_deps", "angha_io_pairs": "synth_io_pairs",
|
| 56 |
-
"angha_exe_wrapper": "synth_exe_wrapper", "angha_iospec": "synth_iospec"}
|
| 57 |
-
|
| 58 |
-
_FEATURES = datasets.Features(
|
| 59 |
-
{
|
| 60 |
-
"path": datasets.Value("string"),
|
| 61 |
-
"func_def": datasets.Value("string"),
|
| 62 |
-
"func_head": datasets.Value("string"),
|
| 63 |
-
"func_head_types": datasets.Value("string"),
|
| 64 |
-
"fname": datasets.Value("string"),
|
| 65 |
-
"signature": datasets.Sequence(datasets.Value("string")),
|
| 66 |
-
# "doc": datasets.Value("string"),
|
| 67 |
-
# "angha_error": datasets.Value("string"),
|
| 68 |
-
# "real_error": datasets.Value("string"),
|
| 69 |
-
"asm": datasets.Sequence({'target': datasets.Value("string"), 'code': datasets.Value("string")}), # unflat dict#Optional[Dict[str, Optional[FuncAsm]]] = None
|
| 70 |
-
"synth_deps": datasets.Value("string"),
|
| 71 |
-
"real_deps": datasets.Value("string"),
|
| 72 |
-
"synth_io_pairs": datasets.Sequence({
|
| 73 |
-
"input": datasets.Sequence({'var': datasets.Value("string"), 'value': datasets.Value("string")}),
|
| 74 |
-
"output": datasets.Sequence({'var': datasets.Value("string"), 'value': datasets.Value("string")}),
|
| 75 |
-
"dummy_funcs": datasets.Value("string"),
|
| 76 |
-
"dummy_funcs_seed": datasets.Value("int64")
|
| 77 |
-
}),
|
| 78 |
-
"real_io_pairs": datasets.Sequence({
|
| 79 |
-
"input": datasets.Sequence({'var': datasets.Value("string"), 'value': datasets.Value("string")}),
|
| 80 |
-
"output": datasets.Sequence({'var': datasets.Value("string"), 'value': datasets.Value("string")}),
|
| 81 |
-
"dummy_funcs": datasets.Value("string"),
|
| 82 |
-
"dummy_funcs_seed": datasets.Value("int64")
|
| 83 |
-
}),
|
| 84 |
-
# "angha_io_error": datasets.Value("string"),
|
| 85 |
-
# "real_io_error": datasets.Value("string"),
|
| 86 |
-
"synth_exe_wrapper": datasets.Value("string"),
|
| 87 |
-
"real_exe_wrapper": datasets.Value("string"),
|
| 88 |
-
# "angha_io_pairs_are_trivial": datasets.Value("bool"),
|
| 89 |
-
# "real_io_pairs_are_trivial": datasets.Value("bool"),
|
| 90 |
-
"ref": datasets.Value("string"),
|
| 91 |
-
"synth_iospec": datasets.Value("string"), # serialized, TODO: improve
|
| 92 |
-
"real_iospec": datasets.Value("string")
|
| 93 |
-
}
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
class ExeBenchConfig(datasets.BuilderConfig):
|
| 98 |
-
"""BuilderConfig for ExeBench."""
|
| 99 |
-
|
| 100 |
-
def __init__(self, *args, **kwargs):
|
| 101 |
-
"""BuilderConfig for The Pile.
|
| 102 |
-
Args:
|
| 103 |
-
**kwargs: keyword arguments forwarded to super.
|
| 104 |
-
"""
|
| 105 |
-
super().__init__(
|
| 106 |
-
*args,
|
| 107 |
-
**kwargs,
|
| 108 |
-
)
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
class ExeBench(datasets.GeneratorBasedBuilder):
|
| 112 |
-
"""ExeBench dataset"""
|
| 113 |
-
|
| 114 |
-
BUILDER_CONFIGS = [
|
| 115 |
-
ExeBenchConfig(
|
| 116 |
-
name="ExeBench",
|
| 117 |
-
version=datasets.Version("1.0.4"),
|
| 118 |
-
description="Executable C dataset"
|
| 119 |
-
),
|
| 120 |
-
]
|
| 121 |
-
|
| 122 |
-
def _info(self):
|
| 123 |
-
"""Give information and typings for the dataset."""
|
| 124 |
-
return datasets.DatasetInfo(
|
| 125 |
-
# This is the description that will appear on the datasets page.
|
| 126 |
-
description=_DESCRIPTION,
|
| 127 |
-
# This defines the different columns of the dataset and their types
|
| 128 |
-
features=_FEATURES,
|
| 129 |
-
# If there's a common (input, target) tuple from the features,
|
| 130 |
-
# specify them here. They'll be used if as_supervised=True in
|
| 131 |
-
# builder.as_dataset.
|
| 132 |
-
supervised_keys=None,
|
| 133 |
-
# Homepage of the dataset for documentation
|
| 134 |
-
homepage=_HOMEPAGE,
|
| 135 |
-
# License for the dataset if available
|
| 136 |
-
license=_LICENSE,
|
| 137 |
-
# Citation for the dataset
|
| 138 |
-
citation=_CITATION,
|
| 139 |
-
)
|
| 140 |
-
|
| 141 |
-
def _split_generators(self, dl_manager):
|
| 142 |
-
"""Returns SplitGenerators."""
|
| 143 |
-
urls_to_download = {
|
| 144 |
-
"train_not_compilable": f"{_URL}train_no_compilable.tar.gz",
|
| 145 |
-
"train_synth_compilable": f"{_URL}train_synth_compilable.tar.gz",
|
| 146 |
-
"train_real_compilable": f"{_URL}train_real_compilable.tar.gz",
|
| 147 |
-
"train_synth_simple_io": f"{_URL}train_synth_simple_io.tar.gz",
|
| 148 |
-
"train_real_simple_io": f"{_URL}train_real_simple_io.tar.gz",
|
| 149 |
-
"train_synth_rich_io": f"{_URL}train_synth_rich_io.tar.gz",
|
| 150 |
-
"valid_synth": f"{_URL}valid_synth.tar.gz",
|
| 151 |
-
"valid_real": f"{_URL}valid_real.tar.gz",
|
| 152 |
-
"test_synth": f"{_URL}test_synth.tar.gz",
|
| 153 |
-
"test_real": f"{_URL}test_real.tar.gz",
|
| 154 |
-
}
|
| 155 |
-
downloaded_files = dl_manager.download_and_extract(urls_to_download)
|
| 156 |
-
|
| 157 |
-
return [
|
| 158 |
-
datasets.SplitGenerator(name='train_not_compilable',
|
| 159 |
-
gen_kwargs={"files": downloaded_files["train_not_compilable"]}),
|
| 160 |
-
datasets.SplitGenerator(name='train_synth_compilable',
|
| 161 |
-
gen_kwargs={"files": downloaded_files["train_synth_compilable"]}),
|
| 162 |
-
datasets.SplitGenerator(name='train_real_compilable',
|
| 163 |
-
gen_kwargs={"files": downloaded_files["train_real_compilable"]}),
|
| 164 |
-
datasets.SplitGenerator(name='train_synth_simple_io',
|
| 165 |
-
gen_kwargs={"files": downloaded_files["train_synth_simple_io"]}),
|
| 166 |
-
datasets.SplitGenerator(name='train_real_simple_io',
|
| 167 |
-
gen_kwargs={"files": downloaded_files["train_real_simple_io"]}),
|
| 168 |
-
datasets.SplitGenerator(name='train_synth_rich_io',
|
| 169 |
-
gen_kwargs={"files": downloaded_files["train_synth_rich_io"]}),
|
| 170 |
-
datasets.SplitGenerator(name='valid_synth',
|
| 171 |
-
gen_kwargs={"files": downloaded_files["valid_synth"]}),
|
| 172 |
-
datasets.SplitGenerator(name='valid_real',
|
| 173 |
-
gen_kwargs={"files": downloaded_files["valid_real"]}),
|
| 174 |
-
datasets.SplitGenerator(name='test_synth',
|
| 175 |
-
gen_kwargs={"files": downloaded_files["test_synth"]}),
|
| 176 |
-
datasets.SplitGenerator(name='test_real',
|
| 177 |
-
gen_kwargs={"files": downloaded_files["test_real"]}),
|
| 178 |
-
]
|
| 179 |
-
|
| 180 |
-
def _generate_examples(self, files):
|
| 181 |
-
"""Yield examples as (key, example) tuples."""
|
| 182 |
-
key = 0
|
| 183 |
-
import zstandard as zstd
|
| 184 |
-
|
| 185 |
-
for path in Path(files).rglob('*.jsonl.zst'):
|
| 186 |
-
with zstd.open(open(path, "rb"), "rt", encoding="utf-8") as f:
|
| 187 |
-
for row in f:
|
| 188 |
-
data = json.loads(row)
|
| 189 |
-
data = data['text']
|
| 190 |
-
data = self._fixes(data)
|
| 191 |
-
for io_pairs_kind in ('synth_io_pairs', 'real_io_pairs'):
|
| 192 |
-
if data[io_pairs_kind]:
|
| 193 |
-
new_io_pairs = []
|
| 194 |
-
for e in data[io_pairs_kind]:
|
| 195 |
-
new_e = {}
|
| 196 |
-
new_e['input'] = [{'var': var, 'value': json.dumps(value)} for (var, value) in e['input'].items()] if e['input'] else []
|
| 197 |
-
new_e['output'] = [{'var': var, 'value': json.dumps(value)} for (var, value) in e['output'].items()] if e['output'] else []
|
| 198 |
-
new_e['dummy_funcs'] = e['dummy_funcs']
|
| 199 |
-
new_e['dummy_funcs_seed'] = e['dummy_funcs_seed']
|
| 200 |
-
new_io_pairs.append(new_e)
|
| 201 |
-
data[io_pairs_kind] = new_io_pairs
|
| 202 |
-
data['synth_iospec'] = json.dumps(data['synth_iospec'])
|
| 203 |
-
data['real_iospec'] = json.dumps(data['real_iospec'])
|
| 204 |
-
yield key, data
|
| 205 |
-
key += 1
|
| 206 |
-
|
| 207 |
-
def _fixes(self, row):
|
| 208 |
-
if 'angha_iospec' not in row:
|
| 209 |
-
row['angha_iospec'] = None
|
| 210 |
-
if 'real_iospec' not in row:
|
| 211 |
-
row['real_iospec'] = None
|
| 212 |
-
if 'func_head_types' not in row:
|
| 213 |
-
row['func_head_types'] = ''
|
| 214 |
-
row['asm'] = [{'target': target, 'code': code['func_asm'] if code else None} for (target, code) in
|
| 215 |
-
row['asm'].items()] # TODO: pre_asm etc
|
| 216 |
-
for removed_key in _REMOVED_FEATURES:
|
| 217 |
-
if removed_key in row:
|
| 218 |
-
del row[removed_key]
|
| 219 |
-
for original_key, new_key in _RENAMED_FEATURES.items():
|
| 220 |
-
row[new_key] = row[original_key]
|
| 221 |
-
del row[original_key]
|
| 222 |
-
return row
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
train_no_compilable.tar.gz
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:c182b4c62dd8793e42fa33e34151053c9fa6ec12ede9145661b046e29182ede5
|
| 3 |
-
size 465629449
|
|
|
|
|
|
|
|
|
|
|
|
train_real_compilable.tar.gz
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:3dee594ee4cf70fe2e35eca6ee395157458a8d78dce8ddc1747b864d3b4d8326
|
| 3 |
-
size 1574773269
|
|
|
|
|
|
|
|
|
|
|
|
train_synth_compilable.tar.gz
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5c5396923f14b56bd7d0481f3a84be3349e8aa36c66e62174cccd557408ff8cc
|
| 3 |
-
size 8263470418
|
|
|
|
|
|
|
|
|
|
|
|
train_synth_rich_io.tar.gz
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:a3871d931615f852eb32213946f215a03d04f6741efe3b961805d8988715bc9f
|
| 3 |
-
size 368732571
|
|
|
|
|
|
|
|
|
|
|
|
train_synth_simple_io.tar.gz
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:dc1a819467a4814ff6fce0f6def277046ba4b485cf36bec079f55471b4b09118
|
| 3 |
-
size 1296875463
|
|
|
|
|
|
|
|
|
|
|
|
valid_synth.tar.gz
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5824f4d0eabc89fdac44a050fdb43584f426b97f62b38f24284e54c0f80bb396
|
| 3 |
-
size 16583586
|
|
|
|
|
|
|
|
|
|
|
|