forked from Kolkir/code2seq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathargs.py
63 lines (56 loc) · 1.53 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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="",
help='starts prediction mode, argument is "cpp" or "java" dependin on language model',
)
parser.add_argument(
"-c",
"--continue_training_from_checkpoint",
dest="continue_from_checkpoint",
type=str,
help='Continue training model from a previous checkpoint, if it exists.',
)
parser.add_argument("--debug", action="store_true")
parser.add_argument("--seed", type=int, default=239)
return parser.parse_args()