verifiers 0.4.2.dev28__py3-none-any.whl → 0.4.2.dev29__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.
@@ -3,13 +3,24 @@
3
3
 
4
4
  import re
5
5
  import sys
6
+ from pathlib import Path
6
7
 
7
- from pydantic import AliasChoices, Field, field_validator
8
+ from pydantic import AliasChoices, Field, field_validator, model_validator
8
9
  from pydantic_config import BaseConfig
9
10
 
10
11
  IDX_RANGE = re.compile(r"(\d*):(\d*)(?::(\d*))?")
11
12
 
12
13
 
14
+ class TaskMatchFilesConfig(BaseConfig):
15
+ """Newline-delimited text files with more entries for each `TaskMatchConfig`
16
+ list, one entry per line. Blank lines are skipped."""
17
+
18
+ idx: Path | None = None
19
+ ids: Path | None = None
20
+ keys: Path | None = None
21
+ names: Path | None = None
22
+
23
+
13
24
  class TaskMatchConfig(BaseConfig):
14
25
  """Tasks named by position or identity; a task matches when any list names it."""
15
26
 
@@ -24,6 +35,10 @@ class TaskMatchConfig(BaseConfig):
24
35
  """`Task.key` values, as recorded on each trace (`task.key`)."""
25
36
  names: list[str] = Field(default_factory=list)
26
37
  """`TaskData.name` values."""
38
+ files: TaskMatchFilesConfig = TaskMatchFilesConfig()
39
+ """Files whose lines extend the lists above, for selections too long to write
40
+ inline (`files.ids = "ids.txt"`). Validation reads them into the lists and
41
+ resets `files`."""
27
42
 
28
43
  @field_validator("idx", mode="before")
29
44
  @classmethod
@@ -36,6 +51,19 @@ class TaskMatchConfig(BaseConfig):
36
51
  items.extend(_parse_idx_item(part) for part in parts)
37
52
  return items
38
53
 
54
+ @model_validator(mode="after")
55
+ def _read_files(self):
56
+ for field, path in self.files:
57
+ if path is None:
58
+ continue
59
+ lines = [line.strip() for line in path.read_text().splitlines()]
60
+ entries = [line for line in lines if line]
61
+ if field == "idx":
62
+ entries = [_parse_idx_item(entry) for entry in entries]
63
+ getattr(self, field).extend(entries)
64
+ self.files = TaskMatchFilesConfig()
65
+ return self
66
+
39
67
  @property
40
68
  def empty(self) -> bool:
41
69
  return not (self.idx or self.ids or self.keys or self.names)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: verifiers
3
- Version: 0.4.2.dev28
3
+ Version: 0.4.2.dev29
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
@@ -44,7 +44,7 @@ verifiers/v1/configs/retries.py,sha256=GIrwS0lnMKnlQ_Wj1Z2J6NlEYK4jX5weZxYmQmLcp
44
44
  verifiers/v1/configs/runtime.py,sha256=7To2aecnYuv_ThVt5OIlKUiocldmt4O0hZzkSwuJsBI,11773
45
45
  verifiers/v1/configs/sampling.py,sha256=bd6lietww4htrNYmUEqwK5yfKMhUT3nEjHoCg5xl_ys,1174
46
46
  verifiers/v1/configs/scoring.py,sha256=8t5NrQU9b8R9dGdcG-aQm_U1m3TgeMIbw_XUN4esoF0,3115
47
- verifiers/v1/configs/select.py,sha256=_HdcepQaJ1sDCYcs7Vqx72npDwHGOgUjsLDZmcgnonU,4743
47
+ verifiers/v1/configs/select.py,sha256=bLMJAb7i23IxU6BZMIS0Q_K5JYLlcwL8zi87REhrccc,5827
48
48
  verifiers/v1/configs/task.py,sha256=3CB9pumHdxAHlxLKuLEiCfQPW37tNqy_HC6DgG2GKj4,2958
49
49
  verifiers/v1/configs/taskset.py,sha256=rQow8AJL34n-ZVQ_4GPjPIW5fzBL5QU_RTjJO9tlmwU,945
50
50
  verifiers/v1/configs/cli/__init__.py,sha256=YMDUPdbRlDJ77dhj3QqzmyRhqNgUvuQdpj_bdBqzZPM,78
@@ -193,8 +193,8 @@ verifiers/v1/utils/scope.py,sha256=zbs4pj6AVk4jywlAJ3AX0Q0_kzB9dBB02nY-9H4ELdQ,8
193
193
  verifiers/v1/utils/score.py,sha256=493yJVMw8teCu9JxapxMFPFzI0hNUqdo0Y2nGW4kckk,6200
194
194
  verifiers/v1/utils/trace_store.py,sha256=Qo9qvsJAl8PoRUavjQAfUB2VNxmUtYQtU2ejLKPzY9c,3382
195
195
  verifiers/v1/utils/version.py,sha256=-obEo_-l9-D8FLef4hYxncOe-uJpxrM1g2Hig_37Sgs,1607
196
- verifiers-0.4.2.dev28.dist-info/METADATA,sha256=_IrZBtOKwCdUNW8pZxOcC--V48LwcZTugf8J3vLgc3E,5142
197
- verifiers-0.4.2.dev28.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
198
- verifiers-0.4.2.dev28.dist-info/entry_points.txt,sha256=3M8Wr0w1cUKiB-fJ6YHB6eK5WuKYg-Y3OC4wCuUje_c,174
199
- verifiers-0.4.2.dev28.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
- verifiers-0.4.2.dev28.dist-info/RECORD,,
196
+ verifiers-0.4.2.dev29.dist-info/METADATA,sha256=vrJ8ZEQ7TSZnoOZt4GXFatKpwhMc26J96t4y3zvgRNE,5142
197
+ verifiers-0.4.2.dev29.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
198
+ verifiers-0.4.2.dev29.dist-info/entry_points.txt,sha256=3M8Wr0w1cUKiB-fJ6YHB6eK5WuKYg-Y3OC4wCuUje_c,174
199
+ verifiers-0.4.2.dev29.dist-info/licenses/LICENSE,sha256=v0RrUsdV3IDoZhrRce297IXS3xMHNJ-_LdLpFAUWb9k,1072
200
+ verifiers-0.4.2.dev29.dist-info/RECORD,,