cyrilzhang commited on
Commit
e658057
·
1 Parent(s): 4073827

Update ace.py

Browse files
Files changed (1) hide show
  1. ace.py +18 -7
ace.py CHANGED
@@ -1,4 +1,5 @@
1
- # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
 
2
  #
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
  # you may not use this file except in compliance with the License.
@@ -38,12 +39,22 @@ class MockupDataset(datasets.GeneratorBasedBuilder):
38
 
39
  VERSION = datasets.Version("0.0.0")
40
  BUILDER_CONFIGS = []
 
 
 
 
 
 
 
 
 
 
41
 
42
  def _info(self):
43
  features = datasets.Features(
44
  {
45
- "x": datasets.Sequence(datasets.Value("int64"), length=-1),
46
- "y": datasets.Sequence(datasets.Value("int64"), length=-1)
47
  }
48
  )
49
 
@@ -67,8 +78,8 @@ class MockupDataset(datasets.GeneratorBasedBuilder):
67
 
68
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
69
  def _generate_examples(self, split):
70
- for i in range(10):
71
- yield i, {
72
- "x": [0,1,0,1,0],
73
- "y": [1,0,1,0,1]
74
  }
 
1
+ # Copyright 2020 The HuggingFace Datasets Authors.
2
+ # Copyright 2023 Cyril Zhang.
3
  #
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
  # you may not use this file except in compliance with the License.
 
39
 
40
  VERSION = datasets.Version("0.0.0")
41
  BUILDER_CONFIGS = []
42
+
43
+ def __init__(self, name, data_config={}, **kwargs):
44
+ super().__init__(name=name, **kwargs)
45
+
46
+ if 'length' not in data_config:
47
+ data_config['length'] = 20
48
+ if 'size' not in data_config:
49
+ data_config['size'] = 100
50
+
51
+ self.data_config = data_config
52
 
53
  def _info(self):
54
  features = datasets.Features(
55
  {
56
+ "x": datasets.Value("null"),
57
+ "y": datasets.Value("null")
58
  }
59
  )
60
 
 
78
 
79
  # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
80
  def _generate_examples(self, split):
81
+ for i in range(data_config['size']):
82
+ yield key, {
83
+ "x": [0]*data_config['length'],
84
+ "y": [1]*data_config['length']
85
  }