diff --git a/PaddleNLP/language_model/args.py b/PaddleNLP/language_model/args.py index 1c6957b2bf90eb45bf009e022e7ee27cc4742f4a..2d7d5efd007cda9bbb24ad60b0d9437d4a3516d8 100644 --- a/PaddleNLP/language_model/args.py +++ b/PaddleNLP/language_model/args.py @@ -17,6 +17,7 @@ from __future__ import division from __future__ import print_function import argparse +import ast import distutils.util @@ -36,7 +37,10 @@ def parse_args(): "--data_path", type=str, help="all the data for train,valid,test") parser.add_argument('--para_init', action='store_true') parser.add_argument( - '--use_gpu', type=bool, default=False, help='whether using gpu') + '--use_gpu', + type=ast.literal_eval, + default=False, + help='whether using gpu') parser.add_argument( '--log_path', help='path of the log file. If not set, logs are printed to console')