forked from Kolkir/code2seq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
args.py
25 lines (19 loc) · 1.17 KB
/
args.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from argparse import ArgumentParser
def read_args():
parser = ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument("-d", "--data", dest="data_path",
help="path to preprocessed dataset")
group.add_argument("-l", "--load_path", dest="load_path",
help="path to load model files", metavar="FILE")
parser.add_argument("-m", "--model_path", dest="model_path",
help="path to save and load checkpoints", metavar="FILE", required=False)
parser.add_argument("-s", "--save_path", dest="save_path",
help="path to save model files", metavar="FILE", required=False)
parser.add_argument("-t", "--test", dest="test_path",
help="path to test file", metavar="FILE", required=False)
parser.add_argument('-p', '--predict', dest='predict', type=str, default='java',
help='starts prediction mode, argument is "cpp" or "java" dependin on language model')
parser.add_argument('--debug', action='store_true')
parser.add_argument('--seed', type=int, default=239)
return parser.parse_args()