Datasets:
Download data_types.py from thomeboi/FORGE-Bench: direct link, hf CLI and curl.
- Browser
- Download file 800 Bytes
-
https://huggingface.co/datasets/thomeboi/FORGE-Bench/resolve/main/data_types.py
- Command line
-
hf download hf://datasets/thomeboi/FORGE-Bench/data_types.py
-
curl -L -o data_types.py https://huggingface.co/datasets/thomeboi/FORGE-Bench/resolve/main/data_types.py
800 Bytes
| """Data types for the public FORGE-Bench v15 JSONL release. | |
| The package intentionally uses JSONL and does not require Parquet. | |
| """ | |
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| from typing import Any, Iterator | |
| import json | |
| from pathlib import Path | |
| class TrainExample: | |
| id: str | |
| assembly_id: str | |
| split: str | |
| public_task: dict[str, Any] | |
| reference_output: dict[str, Any] | |
| class TestExample: | |
| id: str | |
| assembly_id: str | |
| split: str | |
| public_task: dict[str, Any] | |
| def read_jsonl(path: str | Path) -> Iterator[dict[str, Any]]: | |
| with Path(path).open(encoding="utf-8") as handle: | |
| for line in handle: | |
| if line.strip(): | |
| yield json.loads(line) | |