Update CLEVR-Sudoku.py
Browse files- CLEVR-Sudoku.py +4 -4
CLEVR-Sudoku.py
CHANGED
@@ -157,17 +157,17 @@ class CLEVRSudoku(datasets.GeneratorBasedBuilder):
|
|
157 |
json_files = os.listdir(json_dir)
|
158 |
print(json_files)
|
159 |
|
160 |
-
for i,
|
161 |
|
162 |
-
print(i,
|
163 |
|
164 |
-
with open(
|
165 |
# Read and parse the JSON content
|
166 |
json_content = json.load(f)
|
167 |
|
168 |
# Extract the specific fields from the JSON
|
169 |
extracted_data = {
|
170 |
-
"file_name":
|
171 |
"id": i, # Extract the 'id' field
|
172 |
"name": json_content.get("name"), # Extract the 'name' field
|
173 |
"solution": json_content.get("solution") # Extract the 'puzzle' field
|
|
|
157 |
json_files = os.listdir(json_dir)
|
158 |
print(json_files)
|
159 |
|
160 |
+
for i, file_name in enumerate(json_files):
|
161 |
|
162 |
+
print(i, file_name)
|
163 |
|
164 |
+
with open(os.path.join(archive_path, top_dir, "json", file_name), 'r') as f:
|
165 |
# Read and parse the JSON content
|
166 |
json_content = json.load(f)
|
167 |
|
168 |
# Extract the specific fields from the JSON
|
169 |
extracted_data = {
|
170 |
+
"file_name": file_name, # The name of the file inside the archive
|
171 |
"id": i, # Extract the 'id' field
|
172 |
"name": json_content.get("name"), # Extract the 'name' field
|
173 |
"solution": json_content.get("solution") # Extract the 'puzzle' field
|