cyrilzhang
commited on
Commit
·
be8b808
1
Parent(s):
e970a6f
Update automata.py
Browse files- automata.py +10 -12
automata.py
CHANGED
@@ -42,23 +42,21 @@ class SyntheticAutomataDataset(datasets.GeneratorBasedBuilder):
|
|
42 |
VERSION = datasets.Version("0.0.0")
|
43 |
BUILDER_CONFIGS = []
|
44 |
|
45 |
-
def __init__(self,
|
46 |
-
print(name, data_config)
|
47 |
super().__init__(**kwargs)
|
48 |
-
print(name, data_config)
|
49 |
|
50 |
"""
|
51 |
Set default configs
|
52 |
"""
|
53 |
-
if '
|
54 |
-
|
55 |
-
if '
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
|
63 |
def _info(self):
|
64 |
features = datasets.Features(
|
|
|
42 |
VERSION = datasets.Version("0.0.0")
|
43 |
BUILDER_CONFIGS = []
|
44 |
|
45 |
+
def __init__(self, config={}, **kwargs):
|
|
|
46 |
super().__init__(**kwargs)
|
|
|
47 |
|
48 |
"""
|
49 |
Set default configs
|
50 |
"""
|
51 |
+
if 'name' not in config:
|
52 |
+
config['name'] = 'parity'
|
53 |
+
if 'length' not in config:
|
54 |
+
config['length'] = 20
|
55 |
+
if 'size' not in config:
|
56 |
+
config['size'] = -1
|
57 |
+
|
58 |
+
self.data_config = config
|
59 |
+
self.sampler = dataset_map[config['name']](config)
|
60 |
|
61 |
def _info(self):
|
62 |
features = datasets.Features(
|