Datasets:
Fixing _generate_examples
Browse files- openpi_v2.py +5 -4
openpi_v2.py
CHANGED
|
@@ -52,7 +52,7 @@ class OpenpiConfig(datasets.BuilderConfig):
|
|
| 52 |
|
| 53 |
def __init__(
|
| 54 |
self,
|
| 55 |
-
|
| 56 |
data_url,
|
| 57 |
citation,
|
| 58 |
url,
|
|
@@ -61,7 +61,7 @@ class OpenpiConfig(datasets.BuilderConfig):
|
|
| 61 |
):
|
| 62 |
|
| 63 |
super(OpenpiConfig, self).__init__(version = datasets.Version(_VERSION), **kwargs)
|
| 64 |
-
self.
|
| 65 |
self.data_url = data_url
|
| 66 |
self.citation = citation
|
| 67 |
self.url = url
|
|
@@ -77,7 +77,7 @@ class OpenpiV2(datasets.GeneratorBasedBuilder):
|
|
| 77 |
"""\
|
| 78 |
"""
|
| 79 |
),
|
| 80 |
-
|
| 81 |
"goal": datasets.Value("string"),
|
| 82 |
"steps": [datasets.Value("string")],
|
| 83 |
"topics": datasets.Value("string"),
|
|
@@ -117,7 +117,7 @@ class OpenpiV2(datasets.GeneratorBasedBuilder):
|
|
| 117 |
def _info(self):
|
| 118 |
return datasets.DatasetInfo(
|
| 119 |
description = _OPENPI_V2_DESCRIPTION,
|
| 120 |
-
features = self.config.
|
| 121 |
supervised_keys = None,
|
| 122 |
homepage = self.config.url,
|
| 123 |
citation = self.config.citation + "\n" + _OPENPI_V2_CITATION
|
|
@@ -146,6 +146,7 @@ class OpenpiV2(datasets.GeneratorBasedBuilder):
|
|
| 146 |
]
|
| 147 |
|
| 148 |
def _generate_examples(self, filepath):
|
|
|
|
| 149 |
logger.info("generating examples from = %s", filepath)
|
| 150 |
|
| 151 |
with open(filepath) as f:
|
|
|
|
| 52 |
|
| 53 |
def __init__(
|
| 54 |
self,
|
| 55 |
+
features,
|
| 56 |
data_url,
|
| 57 |
citation,
|
| 58 |
url,
|
|
|
|
| 61 |
):
|
| 62 |
|
| 63 |
super(OpenpiConfig, self).__init__(version = datasets.Version(_VERSION), **kwargs)
|
| 64 |
+
self.features = features
|
| 65 |
self.data_url = data_url
|
| 66 |
self.citation = citation
|
| 67 |
self.url = url
|
|
|
|
| 77 |
"""\
|
| 78 |
"""
|
| 79 |
),
|
| 80 |
+
features = datasets.Features({
|
| 81 |
"goal": datasets.Value("string"),
|
| 82 |
"steps": [datasets.Value("string")],
|
| 83 |
"topics": datasets.Value("string"),
|
|
|
|
| 117 |
def _info(self):
|
| 118 |
return datasets.DatasetInfo(
|
| 119 |
description = _OPENPI_V2_DESCRIPTION,
|
| 120 |
+
features = self.config.features,
|
| 121 |
supervised_keys = None,
|
| 122 |
homepage = self.config.url,
|
| 123 |
citation = self.config.citation + "\n" + _OPENPI_V2_CITATION
|
|
|
|
| 146 |
]
|
| 147 |
|
| 148 |
def _generate_examples(self, filepath):
|
| 149 |
+
print(filepath)
|
| 150 |
logger.info("generating examples from = %s", filepath)
|
| 151 |
|
| 152 |
with open(filepath) as f:
|