refactor : merge max_prompt_len into max_seq_len, replace assert with raise
- Engine/Scheduler/TaskManager: merge max_prompt_len into max_seq_len - train.py: replace bare assert with ValueError/FileNotFoundError - server.py: add --max_seq_len CLI option - engine.py: remove dead page_size param
This commit is contained in:
@@ -402,15 +402,20 @@ def train(
|
||||
decay_steps: int,
|
||||
**kwargs,
|
||||
):
|
||||
assert train_type in [
|
||||
if train_type not in [
|
||||
"seq",
|
||||
"sft",
|
||||
"dpo",
|
||||
"grpo",
|
||||
"online_grpo",
|
||||
"online_dpo",
|
||||
]
|
||||
assert os.path.exists(param_path)
|
||||
]:
|
||||
raise ValueError(
|
||||
f"Invalid train_type '{train_type}'. "
|
||||
f"Must be one of: seq, sft, dpo, grpo, online_grpo, online_dpo"
|
||||
)
|
||||
if not os.path.exists(param_path):
|
||||
raise FileNotFoundError(f"Model directory not found: {param_path}")
|
||||
if nprocs > 1 and parallel_mode == "none":
|
||||
raise ValueError(
|
||||
"--nprocs > 1 requires --parallel_mode to be 'ddp', 'fsdp', or 'fsdp2'"
|
||||
|
||||
Reference in New Issue
Block a user