Skip to content

Commit

Permalink
add max steps
Browse files Browse the repository at this point in the history
  • Loading branch information
karpathy committed Aug 20, 2022
1 parent 055e7ee commit 0a19a59
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion makemore.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def create_datasets(input_file):
parser.add_argument('--work-dir', '-o', type=str, default='out', help="output working directory")
parser.add_argument('--resume', action='store_true', help="when this flag is used, we will resume optimization from existing model in the workdir")
parser.add_argument('--sample-only', action='store_true', help="just sample from the model and quit, don't train")
parser.add_argument('--num-workers', '-n', type=int, default=0, help="number of data workers for both train/test")
parser.add_argument('--num-workers', '-n', type=int, default=4, help="number of data workers for both train/test")
parser.add_argument('--max-steps', type=int, default=-1, help="max number of optimization steps to run for, or -1 for infinite.")
parser.add_argument('--device', type=str, default='cpu', help="device to use for compute, examples: cpu|cuda|cuda:2|mps")
parser.add_argument('--seed', type=int, default=3407, help="seed")
# sampling
Expand Down Expand Up @@ -439,3 +440,7 @@ def create_datasets(input_file):
print_samples(num=10)

step += 1
# termination conditions
if args.max_steps >= 0 and step >= args.max_steps:
break

0 comments on commit 0a19a59

Please sign in to comment.