verifiers 0.2.2.dev68__py3-none-any.whl → 0.2.2.dev69__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/envs/agentic_judge/env.py +1 -1
- verifiers/v1/state.py +1 -1
- verifiers/v1/tasksets/harbor/taskset.py +5 -1
- verifiers/v1/utils/artifacts.py +38 -13
- {verifiers-0.2.2.dev68.dist-info → verifiers-0.2.2.dev69.dist-info}/METADATA +1 -1
- {verifiers-0.2.2.dev68.dist-info → verifiers-0.2.2.dev69.dist-info}/RECORD +9 -9
- {verifiers-0.2.2.dev68.dist-info → verifiers-0.2.2.dev69.dist-info}/WHEEL +0 -0
- {verifiers-0.2.2.dev68.dist-info → verifiers-0.2.2.dev69.dist-info}/entry_points.txt +0 -0
- {verifiers-0.2.2.dev68.dist-info → verifiers-0.2.2.dev69.dist-info}/licenses/LICENSE +0 -0
verifiers/v1/state.py
CHANGED
|
@@ -9,7 +9,7 @@ from verifiers.v1.utils.generic import concrete_type
|
|
|
9
9
|
class State(BaseModel):
|
|
10
10
|
model_config = ConfigDict(ser_json_inf_nan="constants")
|
|
11
11
|
|
|
12
|
-
artifacts: dict[str, bytes] = Field(default_factory=dict)
|
|
12
|
+
artifacts: dict[str, bytes | None] = Field(default_factory=dict)
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
StateT = TypeVar("StateT", bound=State, default=State)
|
|
@@ -396,7 +396,11 @@ def parse_verifier_extras(
|
|
|
396
396
|
# no such directory (the trace is the record) and Harbor never lets destination
|
|
397
397
|
# affect verifier-side placement, so it cannot change any grading outcome.
|
|
398
398
|
artifacts.append(
|
|
399
|
-
Artifact(
|
|
399
|
+
Artifact(
|
|
400
|
+
source=entry.source,
|
|
401
|
+
exclude=list(entry.exclude or []),
|
|
402
|
+
required=False,
|
|
403
|
+
)
|
|
400
404
|
)
|
|
401
405
|
|
|
402
406
|
hooks: list[CollectHook] = []
|
verifiers/v1/utils/artifacts.py
CHANGED
|
@@ -29,11 +29,12 @@ class Artifact(BaseModel):
|
|
|
29
29
|
source: str
|
|
30
30
|
exclude: list[str] = Field(default_factory=list)
|
|
31
31
|
"""`tar --exclude` patterns, applied when `source` is a directory."""
|
|
32
|
+
required: bool = True
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
async def collect(
|
|
35
36
|
runtime: Runtime, artifacts: list[Artifact] | None = None
|
|
36
|
-
) -> dict[str, bytes]:
|
|
37
|
+
) -> dict[str, bytes | None]:
|
|
37
38
|
"""Tar the convention dir and every declared path out of `runtime`.
|
|
38
39
|
|
|
39
40
|
Keyed by source path; the values are tar archives. Insertion order is the order
|
|
@@ -54,20 +55,42 @@ async def collect(
|
|
|
54
55
|
for a in artifacts or []
|
|
55
56
|
]
|
|
56
57
|
convention = PurePosixPath(ARTIFACTS_DIR)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
declared_paths = [PurePosixPath(artifact.source) for artifact in declared]
|
|
59
|
+
if convention in declared_paths:
|
|
60
|
+
entries = declared
|
|
61
|
+
else:
|
|
62
|
+
sweep_excludes = [
|
|
63
|
+
str(path).lstrip("/")
|
|
64
|
+
for path in declared_paths
|
|
65
|
+
if path.is_relative_to(convention)
|
|
66
|
+
]
|
|
67
|
+
entries = [
|
|
68
|
+
Artifact(
|
|
69
|
+
source=ARTIFACTS_DIR,
|
|
70
|
+
exclude=sweep_excludes,
|
|
71
|
+
required=False,
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
for artifact, path in zip(declared, declared_paths, strict=True):
|
|
75
|
+
if convention.is_relative_to(path):
|
|
76
|
+
artifact = artifact.model_copy(
|
|
77
|
+
update={
|
|
78
|
+
"exclude": [
|
|
79
|
+
*artifact.exclude,
|
|
80
|
+
str(convention).lstrip("/"),
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
entries.append(artifact)
|
|
85
|
+
|
|
86
|
+
collected: dict[str, bytes | None] = {}
|
|
66
87
|
budget = MAX_ARTIFACT_BYTES
|
|
67
88
|
for artifact in entries:
|
|
68
89
|
source = artifact.source
|
|
69
|
-
|
|
70
|
-
|
|
90
|
+
exists = f"test -e {shlex.quote(source)} || test -L {shlex.quote(source)}"
|
|
91
|
+
if (await runtime.run(["sh", "-c", exists], {})).exit_code != 0:
|
|
92
|
+
if not artifact.required:
|
|
93
|
+
collected[source] = None
|
|
71
94
|
continue
|
|
72
95
|
raise RuntimeError(
|
|
73
96
|
f"declared artifact {source!r} does not exist in the runtime"
|
|
@@ -80,7 +103,7 @@ async def collect(
|
|
|
80
103
|
return collected
|
|
81
104
|
|
|
82
105
|
|
|
83
|
-
async def restore(runtime: Runtime, collected: dict[str, bytes]) -> None:
|
|
106
|
+
async def restore(runtime: Runtime, collected: dict[str, bytes | None]) -> None:
|
|
84
107
|
"""Extract `collected` in `runtime` at the original absolute paths."""
|
|
85
108
|
if not collected:
|
|
86
109
|
return
|
|
@@ -97,6 +120,8 @@ async def restore(runtime: Runtime, collected: dict[str, bytes]) -> None:
|
|
|
97
120
|
roots = " ".join(shlex.quote(root) for root in collected)
|
|
98
121
|
await _run(runtime, f"rm -rf -- {roots}", "clear artifact roots")
|
|
99
122
|
for root, archive in collected.items():
|
|
123
|
+
if archive is None:
|
|
124
|
+
continue
|
|
100
125
|
path = f"/tmp/vf-artifact-{uuid.uuid4().hex}.tar"
|
|
101
126
|
await runtime.write(path, archive)
|
|
102
127
|
await _run(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: verifiers
|
|
3
|
-
Version: 0.2.2.
|
|
3
|
+
Version: 0.2.2.dev69
|
|
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
|
|
@@ -178,7 +178,7 @@ verifiers/v1/judge.py,sha256=Rp0WgkBrofmENOVx34LBuLh0vGhWwzTs9MmDnSmt3fA,9348
|
|
|
178
178
|
verifiers/v1/legacy.py,sha256=8ea4uJUy4qrbvTvnvZ0587_2qVrlqdMZdmzhruiDIgM,22696
|
|
179
179
|
verifiers/v1/rollout.py,sha256=yweZAjyJ-gExnfeCrD60CGFd5y88Ou51A1nRXnB1f1A,17485
|
|
180
180
|
verifiers/v1/session.py,sha256=J6ZPuvsg6vMTJAs9dMUMtfdjCuvp6Hom877DVdKFKlY,6912
|
|
181
|
-
verifiers/v1/state.py,sha256=
|
|
181
|
+
verifiers/v1/state.py,sha256=EckF2bWp-vV4b1jYJ9sLI5xrfGuI5spIgYYwW926toI,595
|
|
182
182
|
verifiers/v1/task.py,sha256=D5PKxu6WlqCjv7hE311aaNvBA3QWVWDuPIEwDsq-J7g,9075
|
|
183
183
|
verifiers/v1/taskset.py,sha256=fp2E0IEhL_Ybj9cegZwljfTmW27p_30zTWHFKw_kXE4,4374
|
|
184
184
|
verifiers/v1/trace.py,sha256=_bGHOrE6fRLGm0JYc0PrrrO3lyr-qqOF5Y1bHfViwR0,19347
|
|
@@ -233,7 +233,7 @@ verifiers/v1/dialects/chat.py,sha256=R_otqi5N0snB1QVKIYloNeLHR9kc7OmI06HYg1ir_Lw
|
|
|
233
233
|
verifiers/v1/dialects/responses.py,sha256=ismnxUikPcPUIm80FUTPBbj-Cn1e0yGAsISMEseAWRc,13679
|
|
234
234
|
verifiers/v1/envs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
235
235
|
verifiers/v1/envs/agentic_judge/__init__.py,sha256=6vwtMCQ_cuvuubCF5-nrE5W7gGgzE-LIPKorkM5DXdw,309
|
|
236
|
-
verifiers/v1/envs/agentic_judge/env.py,sha256=
|
|
236
|
+
verifiers/v1/envs/agentic_judge/env.py,sha256=jreQPnbp8pJQSyZW0Me2IW-JipYsczqgohfM4-JCz9c,16968
|
|
237
237
|
verifiers/v1/envs/best_of_n/__init__.py,sha256=mubASiwXMNIhnQFDccNAc7yZ0OFsOVK8hH8WIx9b2A4,119
|
|
238
238
|
verifiers/v1/envs/best_of_n/env.py,sha256=KEUJBCVqblnXP_lEwm3mjGdaikBMkecz8UjOFPBhxc0,1987
|
|
239
239
|
verifiers/v1/envs/single_agent/__init__.py,sha256=r0edAc_6gtHBhPzeBGVcdHZZqSdCPZnLMje6eVgyz5U,138
|
|
@@ -311,7 +311,7 @@ verifiers/v1/serve/server.py,sha256=o2GjMgnNApyN9A2i_7SVL3ui75NTBknQlobfUOVTfdQ,
|
|
|
311
311
|
verifiers/v1/serve/types.py,sha256=y8Cf9wKOZRKDXcThFWVygTFHITJofOinGiIzwjQGCUE,2674
|
|
312
312
|
verifiers/v1/tasksets/__init__.py,sha256=b62O4WDNbGfJH_4NjYmznn5otWovdfvUgJZyoIZyLh8,596
|
|
313
313
|
verifiers/v1/tasksets/harbor/__init__.py,sha256=wwVGA8N7E2Q2qA5WGHuLRrn4DgG5oaRHrCS2RW3NXVY,195
|
|
314
|
-
verifiers/v1/tasksets/harbor/taskset.py,sha256=
|
|
314
|
+
verifiers/v1/tasksets/harbor/taskset.py,sha256=7cUb7um8FUL2vHhvdSVBN04IwFMzYDjdaAEuMqiPftM,18326
|
|
315
315
|
verifiers/v1/tasksets/lean/__init__.py,sha256=oyv-GbJQBvCyGwo7Ysxm2NjZW-aX4j1uDoHU0f-E7xQ,767
|
|
316
316
|
verifiers/v1/tasksets/lean/scoring.py,sha256=sfzsT6MUK0zdMgAQ57_P_0CBaPHy3M7go71QMr5hDrs,10599
|
|
317
317
|
verifiers/v1/tasksets/lean/taskset.py,sha256=XgUqX0uJvHC8sKFhbK92iu6nUGcPuXCUpI3ZBhDcb7c,9025
|
|
@@ -321,7 +321,7 @@ verifiers/v1/tasksets/textarena/__init__.py,sha256=Os2OlBY_pSH0B1DP32RitumgSLpq2
|
|
|
321
321
|
verifiers/v1/tasksets/textarena/taskset.py,sha256=9fa_unlFiFZyuN4I02rW3x4qyRnFWXqwTUZTloQefu0,4433
|
|
322
322
|
verifiers/v1/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
323
323
|
verifiers/v1/utils/aio.py,sha256=0yNFOqB2oO6Qktc6NI_ZSAGuo1aHsIK_wuT1BtmoZ3I,1532
|
|
324
|
-
verifiers/v1/utils/artifacts.py,sha256=
|
|
324
|
+
verifiers/v1/utils/artifacts.py,sha256=vOzbPSuMirUecyylrhvLZ_vAcTd6JTJBztGPDQ0ANNk,6706
|
|
325
325
|
verifiers/v1/utils/compile.py,sha256=Oh4hDVRNsql_BSOMh4kDEuze9_ZF17Q7uzBhhU70UZA,5663
|
|
326
326
|
verifiers/v1/utils/decorators.py,sha256=9CcCwgZlRjVGPqT5G1CFJUHP4OIMuBGkUJZkcI6dnbk,3865
|
|
327
327
|
verifiers/v1/utils/format.py,sha256=NfQo9M5KMzWCZpQaet5YtsJx56vCKAZPfbjZZJLJhhM,2187
|
|
@@ -337,8 +337,8 @@ verifiers/v1/utils/platform.py,sha256=MWZmvyj0iyzNIO0xRhlkCXtFF1plq6EJi8rWlvrFtv
|
|
|
337
337
|
verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
|
|
338
338
|
verifiers/v1/utils/score.py,sha256=-R5Cog14r_tJ6Q_oOfGr5VPAm2CCUhofYZB6B9lm4wM,5787
|
|
339
339
|
verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
|
|
340
|
-
verifiers-0.2.2.
|
|
341
|
-
verifiers-0.2.2.
|
|
342
|
-
verifiers-0.2.2.
|
|
343
|
-
verifiers-0.2.2.
|
|
344
|
-
verifiers-0.2.2.
|
|
340
|
+
verifiers-0.2.2.dev69.dist-info/METADATA,sha256=tD9ocVeDRxpRVMbBoJrIPykg5u9VbHU3vw3oMKkEUSk,4545
|
|
341
|
+
verifiers-0.2.2.dev69.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
342
|
+
verifiers-0.2.2.dev69.dist-info/entry_points.txt,sha256=dF82JUYEFslR1AOW8LZfuBWeZeQoyX4wCRrduklg8-I,551
|
|
343
|
+
verifiers-0.2.2.dev69.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
|
|
344
|
+
verifiers-0.2.2.dev69.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|