verifiers 0.4.2.dev81__py3-none-any.whl → 0.4.2.dev83__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- verifiers/v1/cli/validate.py +1 -8
- verifiers/v1/clients/prompt_cache.py +0 -1
- verifiers/v1/env.py +0 -10
- verifiers/v1/envs/best_of_n_judge/env.py +1 -5
- verifiers/v1/runtimes/backends/prime.py +0 -3
- verifiers/v1/utils/format.py +1 -57
- verifiers/v1/utils/trace_store.py +1 -21
- {verifiers-0.4.2.dev81.dist-info → verifiers-0.4.2.dev83.dist-info}/METADATA +1 -1
- {verifiers-0.4.2.dev81.dist-info → verifiers-0.4.2.dev83.dist-info}/RECORD +12 -12
- {verifiers-0.4.2.dev81.dist-info → verifiers-0.4.2.dev83.dist-info}/WHEEL +0 -0
- {verifiers-0.4.2.dev81.dist-info → verifiers-0.4.2.dev83.dist-info}/entry_points.txt +0 -0
- {verifiers-0.4.2.dev81.dist-info → verifiers-0.4.2.dev83.dist-info}/licenses/LICENSE +0 -0
verifiers/v1/cli/validate.py
CHANGED
|
@@ -18,7 +18,7 @@ from pydantic_config import cli
|
|
|
18
18
|
from pydantic_core import from_json
|
|
19
19
|
|
|
20
20
|
import verifiers.v1 as vf
|
|
21
|
-
from verifiers.v1.cli.output import write_config
|
|
21
|
+
from verifiers.v1.cli.output import output_path, write_config
|
|
22
22
|
from verifiers.v1.cli.resolve import (
|
|
23
23
|
extract_id,
|
|
24
24
|
narrow_taskset_config,
|
|
@@ -86,13 +86,6 @@ def validation_mode(config: ValidateConfig) -> str:
|
|
|
86
86
|
return "all"
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
def output_path(config: ValidateConfig) -> Path:
|
|
90
|
-
"""Where this run writes: `output_dir / run.dir` — the same grouping convention as
|
|
91
|
-
eval and training."""
|
|
92
|
-
assert config.run.dir is not None
|
|
93
|
-
return config.output_dir / config.run.dir
|
|
94
|
-
|
|
95
|
-
|
|
96
89
|
def _write_rows(path: Path, rows: Sequence[ResultRow]) -> None:
|
|
97
90
|
tmp = path.with_suffix(f"{path.suffix}.tmp")
|
|
98
91
|
with tmp.open("w", encoding="utf-8") as f:
|
|
@@ -25,7 +25,6 @@ from verifiers.v1.dialects.base import Dialect
|
|
|
25
25
|
CacheRetention = Literal["none", "short", "long"]
|
|
26
26
|
|
|
27
27
|
_CACHE_MARKERS = frozenset({"cache_control", "prompt_cache_breakpoint"})
|
|
28
|
-
_SCHEMA_KEYS = frozenset({"input_schema", "parameters", "json_schema"})
|
|
29
28
|
_ANTHROPIC_BLOCK_TYPES = frozenset({"text", "image", "tool_result", "document"})
|
|
30
29
|
|
|
31
30
|
|
verifiers/v1/env.py
CHANGED
|
@@ -68,16 +68,6 @@ class RunSlot:
|
|
|
68
68
|
done: bool = False
|
|
69
69
|
started: float | None = None
|
|
70
70
|
|
|
71
|
-
@classmethod
|
|
72
|
-
def finished(cls, episode: Episode) -> "RunSlot":
|
|
73
|
-
return cls(
|
|
74
|
-
task=Task(episode.task.data),
|
|
75
|
-
id=episode.id,
|
|
76
|
-
traces=list(episode.traces),
|
|
77
|
-
episode=episode,
|
|
78
|
-
done=True,
|
|
79
|
-
)
|
|
80
|
-
|
|
81
71
|
|
|
82
72
|
ConfigT = TypeVar("ConfigT", bound=EnvConfig)
|
|
83
73
|
|
|
@@ -19,6 +19,7 @@ from pydantic import BaseModel, ConfigDict, Field
|
|
|
19
19
|
import verifiers.v1 as vf
|
|
20
20
|
from verifiers.v1.envs.agentic_judge.env import (
|
|
21
21
|
HIDDEN_REASONING,
|
|
22
|
+
HINT_SECTION,
|
|
22
23
|
VERDICT_FILE,
|
|
23
24
|
JudgeTaskConfig,
|
|
24
25
|
ScoreConfig,
|
|
@@ -42,11 +43,6 @@ never take a trace's word for an outcome you can check.
|
|
|
42
43
|
|
|
43
44
|
{prompt}"""
|
|
44
45
|
|
|
45
|
-
HINT_SECTION = """\
|
|
46
|
-
## Hints
|
|
47
|
-
|
|
48
|
-
{hint}"""
|
|
49
|
-
|
|
50
46
|
WORKSPACE_NOTE = f"""\
|
|
51
47
|
## Your workspace
|
|
52
48
|
|
|
@@ -40,9 +40,6 @@ from verifiers.v1.utils.scope import run_scope
|
|
|
40
40
|
|
|
41
41
|
logger = get_logger(__name__)
|
|
42
42
|
|
|
43
|
-
EFFECTIVELY_UNBOUNDED_SECONDS = 30 * 24 * 60 * 60
|
|
44
|
-
"""Safety deadline for APIs that require a finite bound. Normal execution remains
|
|
45
|
-
bounded by idle detection or rollout cancellation; 30 days is above any real run."""
|
|
46
43
|
_OUTPUT_TAIL_BYTES = 10 * 1024 * 1024
|
|
47
44
|
"""Maximum retained bytes per command output stream."""
|
|
48
45
|
_PUBLIC_DOMAIN = "sandbox-v2-prod.pinfra.io"
|
verifiers/v1/utils/format.py
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
"""Compact human-readable formatting for display
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from collections.abc import Callable
|
|
6
|
-
from typing import TYPE_CHECKING
|
|
7
|
-
|
|
8
|
-
if TYPE_CHECKING:
|
|
9
|
-
from verifiers.v1.trace import Trace
|
|
1
|
+
"""Compact human-readable duration formatting for display."""
|
|
10
2
|
|
|
11
3
|
|
|
12
4
|
def format_time(seconds: float) -> str:
|
|
@@ -23,51 +15,3 @@ def format_time(seconds: float) -> str:
|
|
|
23
15
|
return f"{int(h)}h {int(rem // 60)}m"
|
|
24
16
|
d, rem = divmod(seconds, 86400)
|
|
25
17
|
return f"{int(d)}d {int(rem // 3600)}h"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def format_count(n: int) -> str:
|
|
29
|
-
"""A compact count (mirrors prime-rl): 936 / 4.8K / 1.5M."""
|
|
30
|
-
if n < 1_000:
|
|
31
|
-
return str(n)
|
|
32
|
-
if n < 1_000_000:
|
|
33
|
-
return f"{n / 1e3:.1f}K"
|
|
34
|
-
return f"{n / 1e6:.1f}M"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
MAX_OVERRIDE_CHARS = 72
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def format_override(value: object) -> str:
|
|
41
|
-
"""A value as one compact segment: dict `{k=v,k=v}`, list/tuple `[a,b]`, else `str`;
|
|
42
|
-
whitespace collapsed and cut to MAX_OVERRIDE_CHARS."""
|
|
43
|
-
if isinstance(value, dict):
|
|
44
|
-
text = "{" + ",".join(f"{k}={v}" for k, v in value.items()) + "}"
|
|
45
|
-
elif isinstance(value, (list, tuple)):
|
|
46
|
-
text = "[" + ",".join(str(v) for v in value) + "]"
|
|
47
|
-
else:
|
|
48
|
-
text = str(value)
|
|
49
|
-
text = " ".join(text.split())
|
|
50
|
-
return (
|
|
51
|
-
text
|
|
52
|
-
if len(text) <= MAX_OVERRIDE_CHARS
|
|
53
|
-
else text[: MAX_OVERRIDE_CHARS - 1] + "…"
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def format_mean(
|
|
58
|
-
traces: list[Trace], value: Callable[[Trace], float], digits: int = 2
|
|
59
|
-
) -> str:
|
|
60
|
-
"""Mean of `value` over completed, non-dropped `traces`: the mean over the non-errored
|
|
61
|
-
ones (error-corrected). When some errored, also append the global mean — over *all*
|
|
62
|
-
completed, an errored trace's value counting as 0 — in parens, so both the error-corrected
|
|
63
|
-
and the raw mean are visible. "—" when nothing has completed (or all errored or dropped)."""
|
|
64
|
-
traces = [t for t in traces if not t.is_dropped]
|
|
65
|
-
if not traces:
|
|
66
|
-
return "—"
|
|
67
|
-
clean = [t for t in traces if not t.has_error]
|
|
68
|
-
if not clean:
|
|
69
|
-
return "—"
|
|
70
|
-
mean = f"{sum(value(t) for t in clean) / len(clean):.{digits}f}"
|
|
71
|
-
if len(clean) < len(traces): # some errored → show the raw global avg alongside
|
|
72
|
-
mean += f" ({sum(value(t) for t in traces) / len(traces):.{digits}f})"
|
|
73
|
-
return mean
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import asyncio
|
|
6
|
-
import json
|
|
7
6
|
from functools import cache
|
|
8
7
|
from pathlib import Path
|
|
9
8
|
|
|
10
9
|
from pydantic import TypeAdapter
|
|
11
10
|
|
|
12
|
-
from verifiers.v1.episode import EnvInfo, Episode
|
|
11
|
+
from verifiers.v1.episode import EnvInfo, Episode
|
|
13
12
|
from verifiers.v1.state import StateT
|
|
14
13
|
from verifiers.v1.task import DataT
|
|
15
14
|
from verifiers.v1.trace import AgentConfigT, Trace
|
|
@@ -42,25 +41,6 @@ def write_episode(
|
|
|
42
41
|
f.write(data + b"\n")
|
|
43
42
|
|
|
44
43
|
|
|
45
|
-
def read_episodes(results_dir: Path, trace_type: type) -> list[WireEpisode]:
|
|
46
|
-
"""Load a run's saved rollouts from `traces.jsonl` with traces typed as
|
|
47
|
-
`trace_type` (`Trace[WireTaskData, ...]` reads any taskset's file without
|
|
48
|
-
importing it)."""
|
|
49
|
-
trace_adapter = type_adapter(trace_type)
|
|
50
|
-
episodes: list[WireEpisode] = []
|
|
51
|
-
with (results_dir / TRACES_FILE).open(encoding="utf-8") as f:
|
|
52
|
-
for line in f:
|
|
53
|
-
if not line.strip():
|
|
54
|
-
continue
|
|
55
|
-
row = json.loads(line)
|
|
56
|
-
record = WireEpisode.model_validate({**row, "traces": []})
|
|
57
|
-
record.traces = [
|
|
58
|
-
trace_adapter.validate_python(trace) for trace in row["traces"]
|
|
59
|
-
]
|
|
60
|
-
episodes.append(record)
|
|
61
|
-
return episodes
|
|
62
|
-
|
|
63
|
-
|
|
64
44
|
async def append_episode(
|
|
65
45
|
results_dir: Path,
|
|
66
46
|
episode: Episode[DataT, StateT, AgentConfigT],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: verifiers
|
|
3
|
-
Version: 0.4.2.
|
|
3
|
+
Version: 0.4.2.dev83
|
|
4
4
|
Summary: Verifiers: Environments for LLM Reinforcement Learning
|
|
5
5
|
Project-URL: Homepage, https://github.com/primeintellect-ai/verifiers
|
|
6
6
|
Project-URL: Documentation, https://github.com/primeintellect-ai/verifiers
|
|
@@ -2,7 +2,7 @@ verifiers/__init__.py,sha256=F5IVMw6mhGaPBMCw7QKk0la_r5mMwydP2hdTTdQucik,352
|
|
|
2
2
|
verifiers/v1/__init__.py,sha256=7JZopLlXRErCQc-x1t-bSzwuenwlbh4-ayh3JrwOd7M,18991
|
|
3
3
|
verifiers/v1/agent.py,sha256=zhg7rn8MjU_57QS_kKTz_UKAG8TwYEPn8nt-ebHuv8A,54286
|
|
4
4
|
verifiers/v1/delta.py,sha256=23USfU7G5L3TBnV3apyuOa0M_uQAgvTo6a4Ke4msRV0,12205
|
|
5
|
-
verifiers/v1/env.py,sha256=
|
|
5
|
+
verifiers/v1/env.py,sha256=1tcWqUEd5GffiJ3aEx_V0WxbzsuzgZd5t-3cOGtf5rM,20302
|
|
6
6
|
verifiers/v1/episode.py,sha256=ExeTkNEBsDuG40m6VogV6Gd4IHdO4SMPIzQSpt_V96U,6984
|
|
7
7
|
verifiers/v1/errors.py,sha256=OieUBIOZ6FW7oKygbXIRoag6RrPxKYpMPfEYPcCnVVE,5863
|
|
8
8
|
verifiers/v1/grading.py,sha256=RV-j71EIeQNC1AeKIDQkS1Y_KTtjJg9x8zF7n2cWr_Y,10100
|
|
@@ -26,12 +26,12 @@ verifiers/v1/cli/output.py,sha256=vCscZ-g-sa-SLWDDQNoXBWelC_Je8lBdodvZGOe__eo,32
|
|
|
26
26
|
verifiers/v1/cli/resolve.py,sha256=Q1EHM7wWQo0YkwJA898qtZbYLaIkjIVq3Q7kUp2YIxs,4346
|
|
27
27
|
verifiers/v1/cli/resume.py,sha256=hqV5AxxqeIInJeEZQerQznuijhMNijFEFcHZIltfLdE,470
|
|
28
28
|
verifiers/v1/cli/run.py,sha256=fB3OyDGjj5leA0kCIuKiiMxJfhv_4afIUwT9_KDXXuE,4988
|
|
29
|
-
verifiers/v1/cli/validate.py,sha256=
|
|
29
|
+
verifiers/v1/cli/validate.py,sha256=8jBVzR2oeTt1CykjSDdDLz2O4sxEl7MOlsGgBTDb8xg,20801
|
|
30
30
|
verifiers/v1/clients/__init__.py,sha256=3rXv205sRheGvG8yNDmFwpq8qK9dlt7S_ia1zGWhNk0,598
|
|
31
31
|
verifiers/v1/clients/base.py,sha256=C0G5lRm3nxt1xmPoA2cweBgCnN2KcLepmCYq1vdDrnU,1691
|
|
32
32
|
verifiers/v1/clients/client.py,sha256=STtNVV8h-ZOtBtr1JH-NxXfuiY7Fehiw-l8hFmUTnq4,7880
|
|
33
33
|
verifiers/v1/clients/eval.py,sha256=GgpHZGh4IW3gC-tOZiFPp62MCL4aHik0b4afz2g3-Qo,8729
|
|
34
|
-
verifiers/v1/clients/prompt_cache.py,sha256
|
|
34
|
+
verifiers/v1/clients/prompt_cache.py,sha256=-OtG21T3s_ZKeZ5XKlFC7lXqvL44uDL-aoc7C3FOJrs,11777
|
|
35
35
|
verifiers/v1/clients/train.py,sha256=L6XDRUbOxkhtN6nt3sGqeAiHTfqNYdXdQewY9tQ6f8k,21134
|
|
36
36
|
verifiers/v1/configs/__init__.py,sha256=X7u6X7B3ieD1HZl79Tv1kg-yPHbT0QLvAebaGqxVtvA,317
|
|
37
37
|
verifiers/v1/configs/agent.py,sha256=xn9j1WcBIGz7LjgW8WOWDvSvk7vPLztisSLVcT2foxk,7530
|
|
@@ -64,7 +64,7 @@ verifiers/v1/envs/agentic_judge/env.py,sha256=AkANEM5mSiGJ-udJWvHKeNMVq4wRcWpXX0
|
|
|
64
64
|
verifiers/v1/envs/best_of_n/__init__.py,sha256=mubASiwXMNIhnQFDccNAc7yZ0OFsOVK8hH8WIx9b2A4,119
|
|
65
65
|
verifiers/v1/envs/best_of_n/env.py,sha256=KEUJBCVqblnXP_lEwm3mjGdaikBMkecz8UjOFPBhxc0,1987
|
|
66
66
|
verifiers/v1/envs/best_of_n_judge/__init__.py,sha256=xEe_uG3CHVa4psZOkbrQV8u9u63HK1iR-jvtuknUZOw,222
|
|
67
|
-
verifiers/v1/envs/best_of_n_judge/env.py,sha256=
|
|
67
|
+
verifiers/v1/envs/best_of_n_judge/env.py,sha256=z5Z3vg3ZItbfwwe8rp9FhoG1Ck9F1mvvpm-Af145jYo,14677
|
|
68
68
|
verifiers/v1/envs/single_agent/__init__.py,sha256=r0edAc_6gtHBhPzeBGVcdHZZqSdCPZnLMje6eVgyz5U,138
|
|
69
69
|
verifiers/v1/envs/single_agent/env.py,sha256=iH-AnS5-5rDZM3MaYFxzaHSVqJAaw9mQJaaJvsDMMX4,854
|
|
70
70
|
verifiers/v1/envs/user_sim/__init__.py,sha256=nnT695HdqjAEouYL5wtVu6MhIp2wf5yuK-EYgxOVx0s,118
|
|
@@ -150,7 +150,7 @@ verifiers/v1/runtimes/runtime.py,sha256=U_0G8DkeTPoyxQRN6Qmjll6FZ0bDwlijW4cC11wM
|
|
|
150
150
|
verifiers/v1/runtimes/strategies.py,sha256=WtIrIpKmvjvqpUfwLUwDNJcgRLE8d-2sx7reks2S2PA,8765
|
|
151
151
|
verifiers/v1/runtimes/backends/custom.py,sha256=Iz1Brd4dBTpO1zYVc2KA0u5sxz5ZUROY_Cdme5W33hM,2875
|
|
152
152
|
verifiers/v1/runtimes/backends/docker.py,sha256=k-xjN6m72LH_FUeQ0rCySpYSxtk__3ZwHhOHA5HQ5Zk,32362
|
|
153
|
-
verifiers/v1/runtimes/backends/prime.py,sha256
|
|
153
|
+
verifiers/v1/runtimes/backends/prime.py,sha256=LGqWsGSsxZGirdIKL7IJPVOWQT9Go5nzZ1vr-0ipHg4,24971
|
|
154
154
|
verifiers/v1/runtimes/backends/subprocess.py,sha256=naOWJGmcaOlu2ZdRbUwhJicJdxASDRAUhDT0jzDff3w,8591
|
|
155
155
|
verifiers/v1/tasksets/__init__.py,sha256=2ijE3qIlLoUA02g6iysOwWQylyBBQL1GhSpjv8_bp0w,521
|
|
156
156
|
verifiers/v1/tasksets/harbor/__init__.py,sha256=FjW4tM3rgGALMK-8p7ux26G4-d4ZFVmaAmO6Fni6e_g,214
|
|
@@ -172,7 +172,7 @@ verifiers/v1/utils/compile.py,sha256=J5PzohCTCj9UQ1d6rmQB-pTJKLYa_f6-0YMZ9y3yWoA
|
|
|
172
172
|
verifiers/v1/utils/decorators.py,sha256=LbHW0bPkFy-l_TNp48HDDB_PZVr7wvJuVfuo3Qctcbo,5608
|
|
173
173
|
verifiers/v1/utils/env.py,sha256=tMqfwFNRcJPijzrjkbE2VYvBH8eONRtYCWVkXHKpGZQ,1023
|
|
174
174
|
verifiers/v1/utils/eval.py,sha256=lXBsir3rastL31CuXkJi522v6ypAI1ZGQ82IoTkm8IQ,1237
|
|
175
|
-
verifiers/v1/utils/format.py,sha256=
|
|
175
|
+
verifiers/v1/utils/format.py,sha256=ij6sMMitJL7JCfGPSJp60gBZPYRVOpMGlTaiiV_UPag,594
|
|
176
176
|
verifiers/v1/utils/generic.py,sha256=lKIzu5rvwnuSlr_kTFdupf-ElubjjvOo0vnBHYMUpC4,5036
|
|
177
177
|
verifiers/v1/utils/git.py,sha256=LJGHrIxZs7eg58e_W7TiNYbZQCXMBERgkP42F4IOk9A,8363
|
|
178
178
|
verifiers/v1/utils/image.py,sha256=OFw_wdwVtbdwa8uJ3X3vYfhpUAi0CTH5HMBupjVsRRQ,282
|
|
@@ -186,10 +186,10 @@ verifiers/v1/utils/prime.py,sha256=wXc7ThzQKYCUBUPdlW7fol7yubQv5xBuW-_CXi7EHYw,9
|
|
|
186
186
|
verifiers/v1/utils/retries.py,sha256=cEOrD5m59NJUzBsU9jd6p5uq1rtnbGrptd20MWOVlB0,6169
|
|
187
187
|
verifiers/v1/utils/scope.py,sha256=zbs4pj6AVk4jywlAJ3AX0Q0_kzB9dBB02nY-9H4ELdQ,855
|
|
188
188
|
verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
|
|
189
|
-
verifiers/v1/utils/trace_store.py,sha256=
|
|
189
|
+
verifiers/v1/utils/trace_store.py,sha256=V7lBiwyuSoYP6VYwjIR1woF_zf6fKqM8t9Mz2okPBV4,2587
|
|
190
190
|
verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
|
|
191
|
-
verifiers-0.4.2.
|
|
192
|
-
verifiers-0.4.2.
|
|
193
|
-
verifiers-0.4.2.
|
|
194
|
-
verifiers-0.4.2.
|
|
195
|
-
verifiers-0.4.2.
|
|
191
|
+
verifiers-0.4.2.dev83.dist-info/METADATA,sha256=bO__r6GkL3X63FOdDxNkJbc4mtATU6qdaQsSf1EftaM,5116
|
|
192
|
+
verifiers-0.4.2.dev83.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
193
|
+
verifiers-0.4.2.dev83.dist-info/entry_points.txt,sha256=qdMg7ajiFpDsHf7tuPMRclJXizu1J6LTWawS5YS0B0I,137
|
|
194
|
+
verifiers-0.4.2.dev83.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
|
|
195
|
+
verifiers-0.4.2.dev83.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|