Pathikreet commited on
Commit
a9752a6
·
verified ·
1 Parent(s): d826205

Upload train.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. train.py +7 -9
train.py CHANGED
@@ -530,14 +530,12 @@ def main():
530
  print(f' Mean: {sum(baseline.values())/len(baseline):.3f}')
531
  model.train()
532
 
533
- # Build curriculum-weighted dataset.
534
- # CurriculumSampler starts with only 'easy' unlocked; harder tasks unlock
535
- # during training when easy mean ≥ 0.70 (medium) / medium mean ≥ 0.65 (hard).
536
- # Dataset is built once at start — gating in env_reward_fn handles redirection.
537
- print('\n[DATASET] Building curriculum-weighted prompts...')
538
- task_seed_pairs = CURRICULUM.build_dataset_tasks()
539
- print(f'[CURRICULUM] Initial unlocked: {sorted(CURRICULUM.unlocked)} — '
540
- f'{len(task_seed_pairs)} task×seed pairs')
541
  rows = []
542
  for task_id, seed in task_seed_pairs:
543
  try:
@@ -554,7 +552,7 @@ def main():
554
  print(f' skip {task_id} seed={seed}: {e}')
555
 
556
  dataset = Dataset.from_list(rows)
557
- print(f'[DATASET] {len(dataset)} samples | {CURRICULUM.status_line()}')
558
 
559
  # Train
560
  print(f'\n[TRAIN] {NUM_EPOCHS} epochs | {NUM_GENERATIONS} generations/prompt | {len(dataset)} samples')
 
530
  print(f' Mean: {sum(baseline.values())/len(baseline):.3f}')
531
  model.train()
532
 
533
+ # Dataset contains ALL 10 tasks × 5 seeds = 50 prompts (same as Run 1).
534
+ # gate_task() in env_reward_fn handles curriculum redirection at score time:
535
+ # locked tasks get redirected to easy → model still trains, just on easier logic.
536
+ # As curriculum unlocks, redirection stops and model gets real hard task rewards.
537
+ print('\n[DATASET] Building prompts (all 10 tasks × 5 seeds = 50)...')
538
+ task_seed_pairs = [(tid, s) for tid in TRAIN_TASKS for s in range(1, 6)]
 
 
539
  rows = []
540
  for task_id, seed in task_seed_pairs:
541
  try:
 
552
  print(f' skip {task_id} seed={seed}: {e}')
553
 
554
  dataset = Dataset.from_list(rows)
555
+ print(f'[DATASET] {len(dataset)} samples across {len(TRAIN_TASKS)} tasks | curriculum: {CURRICULUM.status_line()}')
556
 
557
  # Train
558
  print(f'\n[TRAIN] {NUM_EPOCHS} epochs | {NUM_GENERATIONS} generations/prompt | {len(dataset)} samples')