verifiers 0.4.1.dev151__py3-none-any.whl → 0.4.2.dev1__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/harnesses/rlm/harness.py +5 -2
- verifiers/v1/rollout.py +2 -0
- verifiers/v1/task.py +1 -1
- verifiers/v1/trace.py +14 -1
- {verifiers-0.4.1.dev151.dist-info → verifiers-0.4.2.dev1.dist-info}/METADATA +1 -1
- {verifiers-0.4.1.dev151.dist-info → verifiers-0.4.2.dev1.dist-info}/RECORD +9 -9
- {verifiers-0.4.1.dev151.dist-info → verifiers-0.4.2.dev1.dist-info}/WHEEL +0 -0
- {verifiers-0.4.1.dev151.dist-info → verifiers-0.4.2.dev1.dist-info}/entry_points.txt +0 -0
- {verifiers-0.4.1.dev151.dist-info → verifiers-0.4.2.dev1.dist-info}/licenses/LICENSE +0 -0
|
@@ -50,6 +50,7 @@ _TRUNCATION_STOPS = {
|
|
|
50
50
|
"max_total_turns": "max_turns",
|
|
51
51
|
"token_budget": "max_output_tokens",
|
|
52
52
|
"compaction_failed": "compaction_failed",
|
|
53
|
+
"format_violation": "format_violation",
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
|
|
@@ -64,13 +65,13 @@ class CompactionConfig(BaseConfig):
|
|
|
64
65
|
nano-rlm's default."""
|
|
65
66
|
max_attempts: PositiveInt | None = None
|
|
66
67
|
"""Summary-generation attempts within one compaction cycle; `None` =
|
|
67
|
-
nano-rlm's default (5)."""
|
|
68
|
+
nano-rlm's default (5). Set 1 for training without summary resampling."""
|
|
68
69
|
|
|
69
70
|
|
|
70
71
|
class RLMHarnessConfig(HarnessConfig):
|
|
71
72
|
dialect: Literal["chat_completions"] = "chat_completions"
|
|
72
73
|
version: str = Field(
|
|
73
|
-
default="
|
|
74
|
+
default="8f86f131f1be43b8679e1fb6aa340f951cf0175d", min_length=1
|
|
74
75
|
)
|
|
75
76
|
"""Git ref (branch, tag, or commit) of nano-rlm to install. Must know every
|
|
76
77
|
field this harness puts on the wire, i.e. be at least the default ref."""
|
|
@@ -292,6 +293,8 @@ class RLMHarness(ACPHarness[RLMHarnessConfig]):
|
|
|
292
293
|
if snapshot.session_id != trace.id:
|
|
293
294
|
raise ValueError("RLM session snapshot does not match the rollout")
|
|
294
295
|
trace.record_metrics(snapshot.metrics)
|
|
296
|
+
if trace.is_format_violation:
|
|
297
|
+
trace.stop("format_violation")
|
|
295
298
|
if condition := _TRUNCATION_STOPS.get(snapshot.last_stop_reason or ""):
|
|
296
299
|
trace.stop(condition)
|
|
297
300
|
|
verifiers/v1/rollout.py
CHANGED
|
@@ -726,6 +726,8 @@ class Rollout:
|
|
|
726
726
|
def _scoring_skip_reason(self) -> str | None:
|
|
727
727
|
"""Why the resolved scoring policy, or the `skip_scoring` stop that ended this trace,
|
|
728
728
|
skips task scoring for it, if either does."""
|
|
729
|
+
if self.trace.is_format_violation:
|
|
730
|
+
return "format_violation"
|
|
729
731
|
if self._scoring_policy.skip_on_truncated and self.trace.is_truncated:
|
|
730
732
|
return "truncated"
|
|
731
733
|
if self._scoring_policy.skip_on_timeout and self.trace.is_timeout:
|
verifiers/v1/task.py
CHANGED
|
@@ -254,7 +254,7 @@ class Task(Generic[DataT, StateT, ConfigT]):
|
|
|
254
254
|
runtime: Runtime | None = None,
|
|
255
255
|
deployment: Deployment | None = None,
|
|
256
256
|
) -> None:
|
|
257
|
-
if self.scoring_deferred:
|
|
257
|
+
if self.scoring_deferred or trace.is_format_violation:
|
|
258
258
|
return
|
|
259
259
|
|
|
260
260
|
def requires_unavailable_resource(fn) -> bool:
|
verifiers/v1/trace.py
CHANGED
|
@@ -677,6 +677,15 @@ class Trace(BaseModel, Generic[DataT, StateT, AgentConfigT]):
|
|
|
677
677
|
def reward(self) -> float:
|
|
678
678
|
return sum(r.value for r in self.rewards.values() if r is not None)
|
|
679
679
|
|
|
680
|
+
@property
|
|
681
|
+
def is_format_violation(self) -> bool:
|
|
682
|
+
"""The harness rejected a terminal model response as invalid training output."""
|
|
683
|
+
return self.stop_condition == "format_violation" or any(
|
|
684
|
+
link.type == "format_violation"
|
|
685
|
+
for node in self.nodes
|
|
686
|
+
for link in node.semantic_parents
|
|
687
|
+
)
|
|
688
|
+
|
|
680
689
|
@property
|
|
681
690
|
def has_error(self) -> bool:
|
|
682
691
|
return not self.ok
|
|
@@ -725,7 +734,7 @@ class Trace(BaseModel, Generic[DataT, StateT, AgentConfigT]):
|
|
|
725
734
|
"""One root-to-leaf view per graph leaf, with no duplicated node storage.
|
|
726
735
|
|
|
727
736
|
A compaction attempt is a dangling physical leaf. It is trainable only when
|
|
728
|
-
the
|
|
737
|
+
the harness resumed from it or declared it a terminal format violation.
|
|
729
738
|
"""
|
|
730
739
|
by_node = {c.node: c for c in self.calls if c.node is not None}
|
|
731
740
|
accepted_compaction_attempts = {
|
|
@@ -754,6 +763,10 @@ class Trace(BaseModel, Generic[DataT, StateT, AgentConfigT]):
|
|
|
754
763
|
trainable=(
|
|
755
764
|
not is_compaction_attempt
|
|
756
765
|
or leaf in accepted_compaction_attempts
|
|
766
|
+
or any(
|
|
767
|
+
link.type == "format_violation"
|
|
768
|
+
for link in self.nodes[leaf].semantic_parents
|
|
769
|
+
)
|
|
757
770
|
),
|
|
758
771
|
mm_token_type_id_map=self.mm_token_type_id_map,
|
|
759
772
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: verifiers
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2.dev1
|
|
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
|
|
@@ -8,13 +8,13 @@ verifiers/v1/grading.py,sha256=Z8J9-UiQA_P8MOMn1CAGsD_SgmrQd6-H_VPmD27ezss,9685
|
|
|
8
8
|
verifiers/v1/graph.py,sha256=wsVUZmCSfu6FuEwEI1cDrroABFbBRnJX9yNVdNOi45A,48126
|
|
9
9
|
verifiers/v1/harness.py,sha256=Hvul6cbb9uWQl4GmHubvcRHqKdfeCY3n44r_ga0csfI,16806
|
|
10
10
|
verifiers/v1/judge.py,sha256=T-TyYVcLGIoyUADYKy_pCBj2CTLhERlct5pmmWqPpTA,10507
|
|
11
|
-
verifiers/v1/rollout.py,sha256=
|
|
11
|
+
verifiers/v1/rollout.py,sha256=LYzSO39TjWWBD1P18B7pfKVptaff60Op1f778U-VU8c,46048
|
|
12
12
|
verifiers/v1/semantic.py,sha256=tX8FYEceuMYauuB3Bc8jLDMS2eR06JjLjTo66R190Fg,4053
|
|
13
13
|
verifiers/v1/session.py,sha256=fuw4eEVxTw_KlkSspxbgejEhmSXJYjX7bUquq2LJ_CU,29640
|
|
14
14
|
verifiers/v1/state.py,sha256=EckF2bWp-vV4b1jYJ9sLI5xrfGuI5spIgYYwW926toI,595
|
|
15
|
-
verifiers/v1/task.py,sha256=
|
|
15
|
+
verifiers/v1/task.py,sha256=emEKiNthgFKyJA3k-omloxSnFGbRR7cXkTiKXJh_3U4,15529
|
|
16
16
|
verifiers/v1/taskset.py,sha256=LE_3ogL7itU2Amk-N20cHkZ7Ev6MznJ0HpC8B1xb4w0,9482
|
|
17
|
-
verifiers/v1/trace.py,sha256=
|
|
17
|
+
verifiers/v1/trace.py,sha256=uipmTRX93FchbQa0g_zt0xhScxXT4ysBm3CZ-Wo_RGI,40650
|
|
18
18
|
verifiers/v1/types.py,sha256=mEy4C9Hl3fK9091kxqalqbVZNRnSI5A0npRHchpsFsM,14800
|
|
19
19
|
verifiers/v1/acp/__init__.py,sha256=jY7nLAbB6uzSl-f6YCz05zBH5tarBLErNTkvV0vlaho,16613
|
|
20
20
|
verifiers/v1/acp/runner.py,sha256=sFsg0UgWeDjpjihejUidIV2yTapVj1Ap0cDTaEktjkI,15484
|
|
@@ -110,7 +110,7 @@ verifiers/v1/harnesses/pi/harness.py,sha256=50Z8kuP1hBaUiXYYQJpcnLu252PNwhRMhmcE
|
|
|
110
110
|
verifiers/v1/harnesses/prime_agent/__init__.py,sha256=xfPC4RrlnyYWaf38tPAOZq4YL6M55lMpj5BoRLmaK8I,171
|
|
111
111
|
verifiers/v1/harnesses/prime_agent/harness.py,sha256=mkBYOdntYzUsj6KPc9Yh-sfZRA37qR_kzmUq0N7jFrQ,12597
|
|
112
112
|
verifiers/v1/harnesses/rlm/__init__.py,sha256=hwx51xTdEWzzYgMj-p4ETNcptoub3IPMDbEdJ4uB8Ns,122
|
|
113
|
-
verifiers/v1/harnesses/rlm/harness.py,sha256=
|
|
113
|
+
verifiers/v1/harnesses/rlm/harness.py,sha256=0NUupikJ_3vacZceYR0hCxISVPPslZexGI-IvfRDggE,14808
|
|
114
114
|
verifiers/v1/harnesses/terminus_2/__init__.py,sha256=l1pwfg1HyVDEqT9efdnFWcXqaZwtKwe7TrplkyxZSA0,166
|
|
115
115
|
verifiers/v1/harnesses/terminus_2/harness.py,sha256=smJbxdcQROXoS-Hg_ydcSQOiLd_IKmv1FbdNSJk5X40,3133
|
|
116
116
|
verifiers/v1/harnesses/terminus_2/program.py,sha256=2n6XX6IFrI20_1woRjy6JZ6x_xcPqzYcSce0MFY99cE,2709
|
|
@@ -189,8 +189,8 @@ verifiers/v1/utils/scope.py,sha256=ivYGJ8GhzyRKbP4L48VsUDWFxpmFsjeaE_7KYBKJ_c0,8
|
|
|
189
189
|
verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
|
|
190
190
|
verifiers/v1/utils/trace_store.py,sha256=Qo9qvsJAl8PoRUavjQAfUB2VNxmUtYQtU2ejLKPzY9c,3382
|
|
191
191
|
verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
|
|
192
|
-
verifiers-0.4.
|
|
193
|
-
verifiers-0.4.
|
|
194
|
-
verifiers-0.4.
|
|
195
|
-
verifiers-0.4.
|
|
196
|
-
verifiers-0.4.
|
|
192
|
+
verifiers-0.4.2.dev1.dist-info/METADATA,sha256=jtS2ERLVahd_jK8-3Td3BevGlyvEerM7vAmI6tRTczY,5136
|
|
193
|
+
verifiers-0.4.2.dev1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
194
|
+
verifiers-0.4.2.dev1.dist-info/entry_points.txt,sha256=3M8Wr0w1cUKiB-fJ6YHB6eK5WuKYg-Y3OC4wCuUje_c,174
|
|
195
|
+
verifiers-0.4.2.dev1.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
|
|
196
|
+
verifiers-0.4.2.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|