Datasets:
Download code/schemas/multipass.py from govtech/municipalbench-full: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/datasets/govtech/municipalbench-full/resolve/main/code/schemas/multipass.py
- Command line
-
hf download hf://datasets/govtech/municipalbench-full/code/schemas/multipass.py
-
curl -L -o multipass.py https://huggingface.co/datasets/govtech/municipalbench-full/resolve/main/code/schemas/multipass.py
1.35 kB
| """Contracts for grouped, retryable multi-pass inference.""" | |
| from __future__ import annotations | |
| from typing import Literal | |
| from pydantic import BaseModel, Field | |
| from schemas.inference import DetectionResult, FormatSeen, ParseStatus | |
| class PassAttempt(BaseModel): | |
| image_id: str | |
| group_id: str | |
| attempt: int = Field(ge=1) | |
| category_ids: list[str] | |
| prompt_hash: str | |
| max_new_tokens: int | |
| status: Literal["ok", "failed"] | |
| detections: list[DetectionResult] = [] | |
| raw_text: str | None = None | |
| parse_status: ParseStatus = "unrecorded" | |
| format_seen: FormatSeen | None = None | |
| parse_error: str | None = None | |
| finish_reason: str | None = None | |
| latency_ms: float = 0.0 | |
| input_tokens: int | None = None | |
| output_tokens: int | None = None | |
| cost_usd: float | None = None | |
| context_limit: int | None = None | |
| context_headroom: int | None = None | |
| provider_diagnostics: dict = {} | |
| box_repairs: dict[str, int] = {} | |
| dropped_per_category: int = 0 | |
| dropped_per_pass: int = 0 | |
| error_type: str | None = None | |
| class PassSummary(BaseModel): | |
| group_id: str | |
| category_ids: list[str] | |
| attempts: int | |
| prompt_hash: str | |
| parse_status: ParseStatus | |
| finish_reason: str | None = None | |
| input_tokens: int | None = None | |
| output_tokens: int | None = None | |
| latency_ms: float = 0.0 | |