Spaces:
Running
Running
Download solar_eval/stores/base.py from dev-strender/proofread-demo: direct link, hf CLI and curl.
- Browser
- Download file 973 Bytes
-
https://huggingface.co/spaces/dev-strender/proofread-demo/resolve/main/solar_eval/stores/base.py
- Command line
-
hf download hf://spaces/dev-strender/proofread-demo/solar_eval/stores/base.py
-
curl -L -o base.py https://huggingface.co/spaces/dev-strender/proofread-demo/resolve/main/solar_eval/stores/base.py
973 Bytes
| """Abstract result store protocol for runner persistence.""" | |
| from typing import Any, Protocol, runtime_checkable | |
| class ResultStore(Protocol): | |
| """Protocol for persisting run results. | |
| The runner calls these methods during execution. Implementations can | |
| persist to MongoDB, JSONL files, or any other backend. | |
| """ | |
| async def update_run(self, run_id: str, data: dict[str, Any]) -> None: | |
| """Update run metadata (status, timestamps, sample counts).""" | |
| ... | |
| async def insert_run_result(self, data: dict[str, Any]) -> str: | |
| """Save a single inference result. Returns result ID.""" | |
| ... | |
| async def create_evaluation(self, data: dict[str, Any]) -> str: | |
| """Save aggregated evaluation scores. Returns evaluation ID.""" | |
| ... | |
| async def insert_eval_details(self, details: list[dict[str, Any]]) -> int: | |
| """Save per-sample evaluation details. Returns count inserted.""" | |
| ... | |