cyrilzhang commited on
Commit
be8b808
·
1 Parent(s): e970a6f

Update automata.py

Browse files
Files changed (1) hide show
  1. 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, name=None, data_config={}, **kwargs):
46
- print(name, data_config)
47
  super().__init__(**kwargs)
48
- print(name, data_config)
49
 
50
  """
51
  Set default configs
52
  """
53
- if 'length' not in data_config:
54
- data_config['length'] = 20
55
- if 'size' not in data_config:
56
- data_config['size'] = -1
57
-
58
- self.data_config = data_config
59
- self.sampler = dataset_map[data_name](data_config)
60
-
61
- print(data_name, self.sampler)
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(