MCPcopy Create free account
hub / github.com/Sin3DM/Sin3DM / sample_args

Function sample_args

src/utils/parser_util.py:148–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

146
147
148def sample_args():
149 parser = argparse.ArgumentParser()
150 add_base_options(parser)
151 add_sampling_options(parser)
152 args = parser.parse_args()
153
154 # print all args
155 print("----- Sampling args -----")
156 for k, v in args.__dict__.items():
157 print("{0:20}".format(k), v)
158
159 # check existence
160 if not os.path.exists(args.tag):
161 raise ValueError(f"Experiment log does not exist: {args.tag}")
162
163 # load saved model args
164 enc_log_dir = encoding_log_dir(args.tag)
165 diff_log_dir = diffusion_log_dir(args.tag)
166 load_and_overwrite_args(args, os.path.join(enc_log_dir, "args.json"))
167 load_and_overwrite_args(args, os.path.join(diff_log_dir, "args.json"), ignore_keys=["timestep_respacing"])
168
169 return args
170
171
172def get_args_by_group(parser, args, group_name):

Callers 1

sample.pyFile · 0.90

Calls 5

add_base_optionsFunction · 0.85
add_sampling_optionsFunction · 0.85
encoding_log_dirFunction · 0.85
diffusion_log_dirFunction · 0.85
load_and_overwrite_argsFunction · 0.85

Tested by

no test coverage detected