verifiers 0.3.2.dev62__py3-none-any.whl → 0.3.2.dev63__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/utils/artifacts.py +26 -4
- {verifiers-0.3.2.dev62.dist-info → verifiers-0.3.2.dev63.dist-info}/METADATA +1 -1
- {verifiers-0.3.2.dev62.dist-info → verifiers-0.3.2.dev63.dist-info}/RECORD +6 -6
- {verifiers-0.3.2.dev62.dist-info → verifiers-0.3.2.dev63.dist-info}/WHEEL +0 -0
- {verifiers-0.3.2.dev62.dist-info → verifiers-0.3.2.dev63.dist-info}/entry_points.txt +0 -0
- {verifiers-0.3.2.dev62.dist-info → verifiers-0.3.2.dev63.dist-info}/licenses/LICENSE +0 -0
verifiers/v1/utils/artifacts.py
CHANGED
|
@@ -91,12 +91,33 @@ async def collect(
|
|
|
91
91
|
raise RuntimeError(f"artifact {artifact.source!r} declared more than once")
|
|
92
92
|
seen.add(artifact.source)
|
|
93
93
|
|
|
94
|
+
# Batch roots to save remote round trips. Leave room below the shell argument
|
|
95
|
+
# limit for the command itself and further quoting by runtime transports.
|
|
96
|
+
batches: list[list[str]] = [[]]
|
|
97
|
+
batch_bytes = 0
|
|
98
|
+
for artifact in entries:
|
|
99
|
+
source_bytes = len(shlex.quote(artifact.source).encode()) + 1
|
|
100
|
+
if batches[-1] and batch_bytes + source_bytes > 8 * 1024:
|
|
101
|
+
batches.append([])
|
|
102
|
+
batch_bytes = 0
|
|
103
|
+
batches[-1].append(artifact.source)
|
|
104
|
+
batch_bytes += source_bytes
|
|
105
|
+
|
|
106
|
+
existence: list[str] = []
|
|
107
|
+
for sources in batches:
|
|
108
|
+
output = await _run(
|
|
109
|
+
runtime,
|
|
110
|
+
f"for source in {shlex.join(sources)}; do "
|
|
111
|
+
'if test -e "$source" || test -L "$source"; then echo 1; else echo 0; fi; '
|
|
112
|
+
"done",
|
|
113
|
+
"check artifact roots",
|
|
114
|
+
)
|
|
115
|
+
existence.extend(output.splitlines())
|
|
94
116
|
collected: dict[str, bytes | None] = {}
|
|
95
117
|
budget = MAX_ARTIFACT_BYTES
|
|
96
|
-
for artifact in entries:
|
|
118
|
+
for artifact, exists in zip(entries, existence, strict=True):
|
|
97
119
|
source = artifact.source
|
|
98
|
-
exists
|
|
99
|
-
if (await runtime.run(["sh", "-c", exists], {})).exit_code != 0:
|
|
120
|
+
if exists != "1":
|
|
100
121
|
if not artifact.required:
|
|
101
122
|
collected[source] = None
|
|
102
123
|
continue
|
|
@@ -205,8 +226,9 @@ def _validate_restore(root: str, archive: bytes | None) -> None:
|
|
|
205
226
|
raise RuntimeError(f"unreadable artifact archive for {root!r}: {exc}") from exc
|
|
206
227
|
|
|
207
228
|
|
|
208
|
-
async def _run(runtime: Runtime, command: str, action: str) ->
|
|
229
|
+
async def _run(runtime: Runtime, command: str, action: str) -> str:
|
|
209
230
|
result = await runtime.run(["sh", "-c", command], {})
|
|
210
231
|
if result.exit_code:
|
|
211
232
|
detail = (result.stderr or result.stdout).strip()[-500:]
|
|
212
233
|
raise RuntimeError(f"failed to {action}: {detail}")
|
|
234
|
+
return result.stdout
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: verifiers
|
|
3
|
-
Version: 0.3.2.
|
|
3
|
+
Version: 0.3.2.dev63
|
|
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
|
|
@@ -172,7 +172,7 @@ verifiers/v1/tasksets/textarena/__init__.py,sha256=Os2OlBY_pSH0B1DP32RitumgSLpq2
|
|
|
172
172
|
verifiers/v1/tasksets/textarena/taskset.py,sha256=9fa_unlFiFZyuN4I02rW3x4qyRnFWXqwTUZTloQefu0,4433
|
|
173
173
|
verifiers/v1/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
174
174
|
verifiers/v1/utils/aio.py,sha256=0yNFOqB2oO6Qktc6NI_ZSAGuo1aHsIK_wuT1BtmoZ3I,1532
|
|
175
|
-
verifiers/v1/utils/artifacts.py,sha256=
|
|
175
|
+
verifiers/v1/utils/artifacts.py,sha256=PFrSkwAyvzHyT6JjlFeGOPIXDmS-uRajaN3am4HZ0TI,9263
|
|
176
176
|
verifiers/v1/utils/compile.py,sha256=5pxy31wx2Q-3pQjOO5B9SH6OT-wwb8r4F1LAl6HMeQA,5835
|
|
177
177
|
verifiers/v1/utils/decorators.py,sha256=vhoN6YoKb15-Fkqmc9RaNlUIbt9WRvNK4zAn2bAxfS4,5367
|
|
178
178
|
verifiers/v1/utils/format.py,sha256=NfQo9M5KMzWCZpQaet5YtsJx56vCKAZPfbjZZJLJhhM,2187
|
|
@@ -189,8 +189,8 @@ verifiers/v1/utils/prime.py,sha256=UTYRjp9cbjNb6CVmBHda-1wWZAIIfxNOmTyNuT7_wL4,9
|
|
|
189
189
|
verifiers/v1/utils/retries.py,sha256=Y2ZgrAjn-qNkRKZP_RVNL_7EK0iaRcZeCa404lpGYi4,5417
|
|
190
190
|
verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
|
|
191
191
|
verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
|
|
192
|
-
verifiers-0.3.2.
|
|
193
|
-
verifiers-0.3.2.
|
|
194
|
-
verifiers-0.3.2.
|
|
195
|
-
verifiers-0.3.2.
|
|
196
|
-
verifiers-0.3.2.
|
|
192
|
+
verifiers-0.3.2.dev63.dist-info/METADATA,sha256=gUF-jEoP0VpPXkADaNMPJUezstcC2q9qL06f985QPoM,4204
|
|
193
|
+
verifiers-0.3.2.dev63.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
194
|
+
verifiers-0.3.2.dev63.dist-info/entry_points.txt,sha256=uqQje0TMsr7k6nXlWxlPs13Si0evb3pVCEDF6c-YL80,241
|
|
195
|
+
verifiers-0.3.2.dev63.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
|
|
196
|
+
verifiers-0.3.2.dev63.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|