Datasets:

toniwuest commited on
Commit
6e667c1
·
verified ·
1 Parent(s): 03375da

Update CLEVR-Sudoku.py

Browse files
Files changed (1) hide show
  1. CLEVR-Sudoku.py +6 -7
CLEVR-Sudoku.py CHANGED
@@ -150,22 +150,21 @@ class CLEVRSudoku(datasets.GeneratorBasedBuilder):
150
  # list items in archive path
151
  print(os.listdir(archive_path))
152
 
153
- json_dir = os.path.join(archive_path, "json")
 
 
 
154
  json_files = os.listdir(json_dir)
155
  print(json_files)
156
 
157
- json_file = os.path.join(archive_path, "json", "sudoku_0.json")
158
  # json_file = dl_manager.download_and_extract(json_file)
159
-
160
- print(os.stat(json_file).st_size == 0)
161
 
162
  with open(json_file, "r") as f:
163
  file = json.load(f)
164
  print(file)
165
 
166
- json_dir = os.path.join(archive_path, "json")
167
- json_files = os.listdir(json_dir)
168
-
169
  for i, file_path in enumerate(json_files):
170
 
171
  print(i, file_path)
 
150
  # list items in archive path
151
  print(os.listdir(archive_path))
152
 
153
+ dirs = [d for d in os.listdir(archive_path) if d != "__MACOSX"]
154
+ top_dir = dirs[0]
155
+
156
+ json_dir = os.path.join(archive_path, top_dir, "json")
157
  json_files = os.listdir(json_dir)
158
  print(json_files)
159
 
160
+ # json_file = os.path.join(archive_path, "json", "sudoku_0.json")
161
  # json_file = dl_manager.download_and_extract(json_file)
162
+ # print(os.stat(json_file).st_size == 0)
 
163
 
164
  with open(json_file, "r") as f:
165
  file = json.load(f)
166
  print(file)
167
 
 
 
 
168
  for i, file_path in enumerate(json_files):
169
 
170
  print(i, file_path)