THUDM / SwissArmyTransformer

SwissArmyTransformer is a flexible and powerful library to develop your own Transformer variants.

Home Page:https://THUDM.github.io/SwissArmyTransformer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sat.arguments.get_args failed to handle the "-h" option

limjcst opened this issue · comments

What I did

I pass the "-h" option to print the help message.
However, my script complains TypeError: %o format: an integer is required, not dict in /usr/lib/python3.8/argparse.py:Line633.
The following snippet can reproduce the phenomenon.

from sat.arguments import get_args
print(get_args(["-h"]))

Suggestion

The following patch works.

diff --git a/sat/arguments.py b/sat/arguments.py
index 5c53bd0..6bfee94 100755
--- a/sat/arguments.py
+++ b/sat/arguments.py
@@ -152,7 +152,7 @@ def add_training_args(parser):
     group.add_argument('--lr-decay-ratio', type=float, default=0.1)
     
     group.add_argument('--warmup', type=float, default=0.01,
-                       help='percentage of data to warmup on (.01 = 1% of all '
+                       help='percentage of data to warmup on (.01 = 1%% of all '
                             'training iters). Default 0.01')
     group.add_argument('--weight-decay', type=float, default=0.01,
                        help='weight decay coefficient for L2 regularization')

Version

The main branch, c5e09a8

Welcome pull request directly~