X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=main.py;h=cae20f89347b076226b6525d561dab1d89a55e8b;hb=6183291906184569c2206c34588d118cc77f74bb;hp=18c0730d7608866041a35874da1c1dc0b641133f;hpb=0d25f8a86e80850cf6a6e27d419f7b043c6028f1;p=mygptrnn.git diff --git a/main.py b/main.py index 18c0730..cae20f8 100755 --- a/main.py +++ b/main.py @@ -24,6 +24,17 @@ else: ###################################################################### + +def str2bool(x): + x = x.lower() + if x in {"1", "true", "yes"}: + return True + elif x in {"0", "false", "no"}: + return False + else: + raise ValueError + + parser = argparse.ArgumentParser( description="An implementation of GPT with cache.", formatter_class=argparse.ArgumentDefaultsHelpFormatter, @@ -68,7 +79,7 @@ parser.add_argument("--min_learning_rate", type=float, default=6e-5) # legacy -parser.add_argument("--legacy_lr_schedule", action="store_true", default=False) +parser.add_argument("--legacy_lr_schedule", type=str2bool, default=True) parser.add_argument("--legacy_large_lr", type=float, default=1e-4)