Reja1 Claude Opus 4.6 commited on
Commit
51823a4
·
1 Parent(s): dd48820

Switch to ImageFolder format for HuggingFace dataset viewer

Browse files

The JSON builder was treating image paths as local files on the
HuggingFace worker, causing FileNotFoundError. Switching to
ImageFolder format by:
- Renaming 'image' to 'file_name' in metadata.jsonl (ImageFolder convention)
- Pointing data_files to images/**/*.png instead of the JSONL
- Adding drop_labels: true to prevent auto-classification

ImageFolder properly resolves image paths via the Hub API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (3) hide show
  1. README.md +3 -2
  2. metadata.jsonl +2 -2
  3. src/benchmark_runner.py +1 -1
README.md CHANGED
@@ -19,7 +19,8 @@ configs:
19
  - config_name: default
20
  data_files:
21
  - split: test
22
- path: metadata.jsonl
 
23
  dataset_info:
24
  features:
25
  - name: image
@@ -242,7 +243,7 @@ The benchmark implements authentic scoring systems for each exam type:
242
  ## Dataset Structure
243
 
244
  * **`metadata.jsonl`**: Contains metadata for each question image with fields:
245
- - `image`: Path to the question image
246
  - `question_id`: Unique identifier (e.g., "N24T3001")
247
  - `exam_name`: Exam type ("NEET", "JEE_MAIN", "JEE_ADVANCED")
248
  - `exam_year`: Year of the exam (integer)
 
19
  - config_name: default
20
  data_files:
21
  - split: test
22
+ path: "images/**/*.png"
23
+ drop_labels: true
24
  dataset_info:
25
  features:
26
  - name: image
 
243
  ## Dataset Structure
244
 
245
  * **`metadata.jsonl`**: Contains metadata for each question image with fields:
246
+ - `file_name`: Path to the question image (relative to repo root)
247
  - `question_id`: Unique identifier (e.g., "N24T3001")
248
  - `exam_name`: Exam type ("NEET", "JEE_MAIN", "JEE_ADVANCED")
249
  - `exam_year`: Year of the exam (integer)
metadata.jsonl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:54ccf60f4d0d436c23518228184ca4184942f735433383c484871ddd9a6e6324
3
- size 130566
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c08f97e33417afb8dd931439b1f4cb62aa30b8bf6e206accb5e12198b383a50c
3
+ size 132878
src/benchmark_runner.py CHANGED
@@ -483,7 +483,7 @@ def run_benchmark(
483
  with open(metadata_path, 'r', encoding='utf-8') as f:
484
  for line in f:
485
  row = json.loads(line)
486
- row["image"] = os.path.join(images_base_dir, row["image"])
487
  row.setdefault("paper_id", None)
488
  records.append(row)
489
 
 
483
  with open(metadata_path, 'r', encoding='utf-8') as f:
484
  for line in f:
485
  row = json.loads(line)
486
+ row["image"] = os.path.join(images_base_dir, row.pop("file_name"))
487
  row.setdefault("paper_id", None)
488
  records.append(row)
489