FORGE-Bench / data_types.py
thomeboi's picture
Upload 7 files
5b79e00 verified
Raw History Blame Contribute Delete
543 Bytes
"""Schema and reader for the FORGE-Bench public test inputs."""
from __future__ import annotations
import json
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Iterator
@dataclass(frozen=True)
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)