MCPcopy Create free account
hub / github.com/adobe-research/custom-diffusion / get_parser

Function get_parser

train.py:117–305  ·  view source on GitHub ↗
(**parser_kwargs)

Source from the content-addressed store, hash-verified

115
116
117def get_parser(**parser_kwargs):
118 def str2bool(v):
119 if isinstance(v, bool):
120 return v
121 if v.lower() in ("yes", "true", "t", "y", "1"):
122 return True
123 elif v.lower() in ("no", "false", "f", "n", "0"):
124 return False
125 else:
126 raise argparse.ArgumentTypeError("Boolean value expected.")
127
128 parser = argparse.ArgumentParser(**parser_kwargs)
129 parser.add_argument(
130 "-n",
131 "--name",
132 type=str,
133 const=True,
134 default="",
135 nargs="?",
136 help="postfix for logdir",
137 )
138 parser.add_argument(
139 "-r",
140 "--resume",
141 type=str,
142 const=True,
143 default="",
144 nargs="?",
145 help="resume from logdir or checkpoint in logdir",
146 )
147 parser.add_argument(
148 "-rc",
149 "--resume-from-checkpoint-custom",
150 type=str,
151 const=True,
152 default="",
153 nargs="?",
154 help="resume from logdir or checkpoint in logdir",
155 )
156 parser.add_argument(
157 "--delta-ckpt",
158 type=str,
159 const=True,
160 default=None,
161 nargs="?",
162 help="resume from logdir or checkpoint in logdir",
163 )
164 parser.add_argument(
165 "-b",
166 "--base",
167 nargs="*",
168 metavar="base_config.yaml",
169 help="paths to base configs. Loaded from left-to-right. "
170 "Parameters can be overwritten or added with command-line options of the form `--key value`.",
171 default=list(),
172 )
173 parser.add_argument(
174 "-t",

Callers 1

train.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected