Skip to content

Commit 2f1a587

Browse files
authored
Fix typo in doc and check selector (#437)
1 parent 904f6bf commit 2f1a587

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

docs/sphinx_doc/source/tutorial/align_with_verl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To match the default training setup of veRL, we set `synchronizer.sync_style=fix
6060
| `data.max_response_length` | `model.max_response_tokens` | - |
6161
| `data.filter_overlong_prompts` | `model.enable_prompt_truncation` | Explained later |
6262
| `data.truncation` | - | Equivalent to `right` |
63-
| `data.shuffle` | `buffer.explorer_input.taskset.task_selector.selector_type:random` | Taskset-specific |
63+
| `data.shuffle` | `buffer.explorer_input.taskset.task_selector.selector_type:shuffle` | Taskset-specific |
6464

6565
💡 Detailed explanation:
6666

docs/sphinx_doc/source_zh/tutorial/align_with_verl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Trinity-RFT 根据功能将强化微调的大量参数分为几个部分,例
6060
| `data.max_response_length` | `model.max_response_tokens` | - |
6161
| `data.filter_overlong_prompts` | `model.enable_prompt_truncation` | 稍后说明 |
6262
| `data.truncation` | - | 等同于 `right` |
63-
| `data.shuffle` | `buffer.explorer_input.taskset.task_selector.selector_type:random` | Taskset-specific |
63+
| `data.shuffle` | `buffer.explorer_input.taskset.task_selector.selector_type:shuffle` | Taskset-specific |
6464

6565
💡 详细说明:
6666

trinity/common/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,8 @@ def _check_interval(self) -> None:
892892
)
893893

894894
def _check_explorer_input(self) -> None:
895+
from trinity.buffer.selector import SELECTORS
896+
895897
if self.mode in {"train", "serve"}:
896898
# no need to check explorer_input in serve mode
897899
return
@@ -932,6 +934,13 @@ def _check_explorer_input(self) -> None:
932934
set_if_none(taskset.rollout_args, "max_tokens", self.model.max_response_tokens)
933935
set_if_none(taskset.format, "chat_template", self.model.custom_chat_template)
934936

937+
# check if selector is supported
938+
selector = SELECTORS.get(taskset.task_selector.selector_type)
939+
if selector is None:
940+
raise ValueError(
941+
f"Selector {taskset.task_selector.selector_type} is not supported."
942+
)
943+
935944
for idx, dataset in enumerate(explorer_input.eval_tasksets):
936945
if not dataset.path:
937946
raise ValueError(f"Eval dataset [{dataset}]'s path is not configured.")

0 commit comments

Comments
 (0)