v5b: add --submit-only SFT mode
Browse files- training/train_sft.py +7 -0
training/train_sft.py
CHANGED
|
@@ -92,6 +92,7 @@ class SftConfig:
|
|
| 92 |
eval_holdout_canonical: int = 3
|
| 93 |
eval_holdout_hard: int = 3
|
| 94 |
eval_every_epoch: bool = True
|
|
|
|
| 95 |
|
| 96 |
lr: float = 5e-5
|
| 97 |
grad_clip: float = 1.0
|
|
@@ -309,6 +310,9 @@ def main() -> None:
|
|
| 309 |
env = InvoiceGuardEnvironment()
|
| 310 |
train_tasks, eval_tasks = split_tasks(cfg)
|
| 311 |
examples = build_sft_examples(tokenizer, env, train_tasks, cfg.max_prompt_tokens)
|
|
|
|
|
|
|
|
|
|
| 312 |
print(f"[setup] train_tasks={len(train_tasks)} eval_tasks={len(eval_tasks)} examples={len(examples)}", flush=True)
|
| 313 |
|
| 314 |
tracker = None
|
|
@@ -434,6 +438,7 @@ def _parse_args() -> SftConfig:
|
|
| 434 |
p.add_argument("--max-prompt-tokens", type=int, default=None)
|
| 435 |
p.add_argument("--no-push", action="store_true")
|
| 436 |
p.add_argument("--no-4bit", action="store_true")
|
|
|
|
| 437 |
args = p.parse_args()
|
| 438 |
|
| 439 |
cfg = SftConfig()
|
|
@@ -459,6 +464,8 @@ def _parse_args() -> SftConfig:
|
|
| 459 |
cfg.push_to_hub = False
|
| 460 |
if args.no_4bit:
|
| 461 |
cfg.use_4bit = False
|
|
|
|
|
|
|
| 462 |
return cfg
|
| 463 |
|
| 464 |
|
|
|
|
| 92 |
eval_holdout_canonical: int = 3
|
| 93 |
eval_holdout_hard: int = 3
|
| 94 |
eval_every_epoch: bool = True
|
| 95 |
+
submit_only: bool = False
|
| 96 |
|
| 97 |
lr: float = 5e-5
|
| 98 |
grad_clip: float = 1.0
|
|
|
|
| 310 |
env = InvoiceGuardEnvironment()
|
| 311 |
train_tasks, eval_tasks = split_tasks(cfg)
|
| 312 |
examples = build_sft_examples(tokenizer, env, train_tasks, cfg.max_prompt_tokens)
|
| 313 |
+
if cfg.submit_only:
|
| 314 |
+
examples = [ex for ex in examples if ex["action_type"] == "submit_final_resolution"]
|
| 315 |
+
print(f"[setup] submit-only mode: filtered to {len(examples)} submit examples", flush=True)
|
| 316 |
print(f"[setup] train_tasks={len(train_tasks)} eval_tasks={len(eval_tasks)} examples={len(examples)}", flush=True)
|
| 317 |
|
| 318 |
tracker = None
|
|
|
|
| 438 |
p.add_argument("--max-prompt-tokens", type=int, default=None)
|
| 439 |
p.add_argument("--no-push", action="store_true")
|
| 440 |
p.add_argument("--no-4bit", action="store_true")
|
| 441 |
+
p.add_argument("--submit-only", action="store_true")
|
| 442 |
args = p.parse_args()
|
| 443 |
|
| 444 |
cfg = SftConfig()
|
|
|
|
| 464 |
cfg.push_to_hub = False
|
| 465 |
if args.no_4bit:
|
| 466 |
cfg.use_4bit = False
|
| 467 |
+
if args.submit_only:
|
| 468 |
+
cfg.submit_only = True
|
| 469 |
return cfg
|
| 470 |
|
| 471 |
|