MCPcopy Create free account
hub / github.com/GanjinZero/BioBART / get_argument_parser

Function get_argument_parser

pretrain_src/utils.py:87–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85 self.logger.error(message, *args, **kwargs)
86
87def get_argument_parser():
88 parser = argparse.ArgumentParser()
89
90 # Required_parameter
91 parser.add_argument(
92 "--config-file",
93 "--cf",
94 help="pointer to the configuration file of the experiment",
95 type=str,
96 required=True)
97 parser.add_argument(
98 "--output_dir",
99 default=None,
100 type=str,
101 required=True,
102 help="The output directory where the model checkpoints will be written."
103 )
104
105 parser.add_argument(
106 "--token_nosing_prob",
107 default=0.15,
108 type=float,
109 help="The probability that a token is masked."
110 )
111
112 # Optional Params
113 parser.add_argument(
114 "--max_seq_length",
115 default=1024,
116 type=int,
117 help=
118 "The maximum total input sequence length after WordPiece tokenization. Sequences "
119 "longer than this will be truncated, and sequences shorter than this will be padded."
120 )
121 parser.add_argument(
122 "--max_predictions_per_seq",
123 "--max_pred",
124 default=80,
125 type=int,
126 help=
127 "The maximum number of masked tokens in a sequence to be predicted.")
128 parser.add_argument('--seed',
129 type=int,
130 default=42,
131 help="random seed for initialization")
132
133 parser.add_argument(
134 "--do_lower_case",
135 default=True,
136 action='store_true',
137 help=
138 "Whether to lower case the input text. True for uncased models, False for cased models."
139 )
140 parser.add_argument("--local_rank",
141 type=int,
142 default=-1,
143 help="local_rank for distributed training on gpus")
144

Callers 1

get_argumentsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected