MCPcopy Create free account
hub / github.com/PaddlePaddle/Research / parse_args

Function parse_args

NLP/DuReader-Checklist-BASELINE/src/args.py:3–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import argparse
2
3def parse_args():
4 parser = argparse.ArgumentParser(description=__doc__)
5 parser.add_argument(
6 "--train_file",
7 type=str,
8 default=None,
9 help="Train data path.")
10 parser.add_argument(
11 "--predict_file",
12 type=str,
13 default=None,
14 help="Predict data path.",
15 nargs='+')
16 parser.add_argument(
17 "--model_type",
18 default=None,
19 type=str,
20 required=True,
21 help="Type of pre-trained model.")
22 parser.add_argument(
23 "--model_name_or_path",
24 default=None,
25 type=str,
26 required=True,
27 help="Path to pre-trained model or shortcut name of model.")
28 parser.add_argument(
29 "--output_dir",
30 default=None,
31 type=str,
32 required=True,
33 help="The output directory where the model predictions and checkpoints will be written."
34 )
35 parser.add_argument(
36 "--max_seq_length",
37 default=128,
38 type=int,
39 help="The maximum total input sequence length after tokenization. Sequences longer "
40 "than this will be truncated, sequences shorter will be padded.")
41 parser.add_argument(
42 "--batch_size",
43 default=8,
44 type=int,
45 help="Batch size per GPU/CPU for training.")
46 parser.add_argument(
47 "--learning_rate",
48 default=5e-5,
49 type=float,
50 help="The initial learning rate for Adam.")
51 parser.add_argument(
52 "--weight_decay",
53 default=0.0,
54 type=float,
55 help="Weight decay if we apply some.")
56 parser.add_argument(
57 "--adam_epsilon",
58 default=1e-8,
59 type=float,
60 help="Epsilon for Adam optimizer.")

Callers 1

run.pyFile · 0.90

Calls 1

parse_argsMethod · 0.45

Tested by

no test coverage detected