MCPcopy Create free account
hub / github.com/pytorch/executorch / args_sanity_checks

Function args_sanity_checks

examples/mediatek/model_export_scripts/phi.py:126–148  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

124
125# flake8: noqa: F405
126def args_sanity_checks(args):
127 check_old_arg(args.config)
128 check_exist(args.config, "Config file")
129 check_ext(args.config, ".json", "Config file")
130 config = get_normalized_config(args.config)
131
132 weight_dir = get_dirname(args.config)
133 check_tokenizer_exist(weight_dir)
134 check_weights_exist(weight_dir)
135
136 check_supported_model(config)
137 check_supported_tokenizer(config)
138
139 if args.preformatter is not None:
140 check_exist(args.preformatter, "Preformatter json file")
141 check_ext(args.preformatter, ".json", "preformatter")
142
143 if args.dataset is not None:
144 check_exist(args.dataset)
145
146 check_between_inclusive(args.num_chunks, 1, config.num_hidden_layers, "num_chunks")
147
148 check_shapes(args.shapes)
149
150
151def print_args(args, exp_name):

Callers 1

mainFunction · 0.70

Calls 11

check_old_argFunction · 0.90
check_existFunction · 0.90
check_extFunction · 0.90
get_normalized_configFunction · 0.90
get_dirnameFunction · 0.90
check_tokenizer_existFunction · 0.90
check_weights_existFunction · 0.90
check_supported_modelFunction · 0.90
check_between_inclusiveFunction · 0.90
check_shapesFunction · 0.90

Tested by

no test coverage detected