MCPcopy Index your code
hub / github.com/openai/guided-diffusion / add_dict_to_argparser

Function add_dict_to_argparser

guided_diffusion/script_util.py:427–434  ·  view source on GitHub ↗
(parser, default_dict)

Source from the content-addressed store, hash-verified

425
426
427def add_dict_to_argparser(parser, default_dict):
428 for k, v in default_dict.items():
429 v_type = type(v)
430 if v is None:
431 v_type = str
432 elif isinstance(v, bool):
433 v_type = str2bool
434 parser.add_argument(f"--{k}", default=v, type=v_type)
435
436
437def args_to_dict(args, keys):

Callers 7

create_argparserFunction · 0.90
create_argparserFunction · 0.90
create_argparserFunction · 0.90
create_argparserFunction · 0.90
create_argparserFunction · 0.90
create_argparserFunction · 0.90
create_argparserFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected