File size: 543 Bytes
5b79e00 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | """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)
|