"""Load the full anonymous benchmark locally; no network or credentials needed.""" from pathlib import Path def load_benchmark(root=None, decode_images=True): from datasets import load_dataset, Image, List root=Path(root) if root else Path(__file__).resolve().parent paths=sorted(str(path) for path in (root/'data').glob('test-*.parquet')) if not paths: raise FileNotFoundError('No benchmark Parquet shards in data/') ds=load_dataset('parquet',data_files={'test':paths},split='test') if not decode_images: ds=ds.cast_column('images',List(Image(decode=False))) return ds if __name__=='__main__': dataset=load_benchmark() assert len(dataset)==3229 example=dataset[0] print('Items:',len(dataset)) print('Example:',example['item_id'],example['task'],len(example['images']))