Datasets:
Download scripts/load_local.py from mjuicem/OmniReasoningBench: direct link, hf CLI and curl.
- Browser
- Download file 706 Bytes
-
https://huggingface.co/datasets/mjuicem/OmniReasoningBench/resolve/main/scripts/load_local.py
- Command line
-
hf download hf://datasets/mjuicem/OmniReasoningBench/scripts/load_local.py
-
curl -L -o load_local.py https://huggingface.co/datasets/mjuicem/OmniReasoningBench/resolve/main/scripts/load_local.py
706 Bytes
| #!/usr/bin/env python3 | |
| """Load a local configuration; print one record's media references.""" | |
| import argparse | |
| from pathlib import Path | |
| from datasets import load_dataset | |
| ap = argparse.ArgumentParser(description=__doc__) | |
| ap.add_argument("--config", default="all") | |
| args = ap.parse_args() | |
| root = Path(__file__).resolve().parents[1] | |
| data = load_dataset(str(root), args.config, split="test") | |
| row = data[0] | |
| print(f"Loaded {len(data):,} records") | |
| if "video_sources" in row: | |
| for video in row["video_sources"]: | |
| print(video["url_kind"], video["url"]) | |
| for image in row["images"]: | |
| print(root / image) | |
| else: | |
| print(root / row["video"]) | |
| if row["image"]: | |
| print(root / row["image"]) | |