Datasets:
Update dataset.py
Browse files- dataset.py +7 -6
dataset.py
CHANGED
|
@@ -1,13 +1,14 @@
|
|
| 1 |
import json
|
| 2 |
import datasets
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
def __init__(self, **kwargs):
|
| 6 |
-
super(
|
| 7 |
|
| 8 |
-
class
|
| 9 |
BUILDER_CONFIGS = [
|
| 10 |
-
|
| 11 |
]
|
| 12 |
|
| 13 |
def _info(self):
|
|
@@ -19,7 +20,7 @@ class MyDataset(datasets.GeneratorBasedBuilder):
|
|
| 19 |
"task_constraint": datasets.Sequence(
|
| 20 |
{
|
| 21 |
"object_list": datasets.Sequence(datasets.Value("string")),
|
| 22 |
-
"constraint_name": datasets.Value("string")
|
| 23 |
}
|
| 24 |
),
|
| 25 |
"objects": datasets.Sequence(datasets.Value("string")),
|
|
@@ -38,7 +39,7 @@ class MyDataset(datasets.GeneratorBasedBuilder):
|
|
| 38 |
)
|
| 39 |
|
| 40 |
def _split_generators(self, dl_manager):
|
| 41 |
-
data_file = dl_manager.download_and_extract("
|
| 42 |
return [
|
| 43 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_file}),
|
| 44 |
]
|
|
|
|
| 1 |
import json
|
| 2 |
import datasets
|
| 3 |
|
| 4 |
+
|
| 5 |
+
class EmbodiedSpatialReasoningConfig(datasets.BuilderConfig):
|
| 6 |
def __init__(self, **kwargs):
|
| 7 |
+
super(EmbodiedSpatialReasoningConfig, self).__init__(**kwargs)
|
| 8 |
|
| 9 |
+
class EmbodiedSpatialReasoning(datasets.GeneratorBasedBuilder):
|
| 10 |
BUILDER_CONFIGS = [
|
| 11 |
+
EmbodiedSpatialReasoningConfig(name="1.0.0", version=datasets.Version("1.0.0"), description="Version 1.0.0"),
|
| 12 |
]
|
| 13 |
|
| 14 |
def _info(self):
|
|
|
|
| 20 |
"task_constraint": datasets.Sequence(
|
| 21 |
{
|
| 22 |
"object_list": datasets.Sequence(datasets.Value("string")),
|
| 23 |
+
"constraint_name": datasets.Value("string"),
|
| 24 |
}
|
| 25 |
),
|
| 26 |
"objects": datasets.Sequence(datasets.Value("string")),
|
|
|
|
| 39 |
)
|
| 40 |
|
| 41 |
def _split_generators(self, dl_manager):
|
| 42 |
+
data_file = dl_manager.download_and_extract("all.json")
|
| 43 |
return [
|
| 44 |
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": data_file}),
|
| 45 |
]
|