akommula commited on
Commit
6cbc3a5
·
1 Parent(s): 9eea934

Fixing _generate_examples

Browse files
Files changed (1) hide show
  1. openpi_v2.py +6 -9
openpi_v2.py CHANGED
@@ -144,17 +144,14 @@ class OpenpiV2(datasets.GeneratorBasedBuilder):
144
  ),
145
  ]
146
 
147
- def _generate_examples(self, filepath, files):
148
  logger.info("generating examples from = %s", filepath)
149
 
150
- for path, f in files:
151
- if path == file_path:
152
- openpi_v2 = json.loads(f.read().decode("utf-8"))
153
- print(openpi_v2)
154
 
155
- for id_ in openpi_v2:
156
- yield id_, openpi_v2[id_]
157
-
158
- break
159
 
160
 
 
144
  ),
145
  ]
146
 
147
+ def _generate_examples(self, filepath):
148
  logger.info("generating examples from = %s", filepath)
149
 
150
+ with open(filepath) as f:
151
+ openpi_v2 = json.loads(f.read().decode("utf-8"))
152
+ print(openpi_v2)
 
153
 
154
+ for id_ in openpi_v2:
155
+ yield id_, openpi_v2[id_]
 
 
156
 
157