MCPcopy Create free account
hub / github.com/XiaoMi/mace / parse_args

Function parse_args

tools/python/encrypt.py:222–266  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

220
221
222def parse_args():
223 parser = argparse.ArgumentParser()
224 parser.add_argument(
225 '--model_name',
226 type=str,
227 help="the namespace of gernerated code")
228 parser.add_argument(
229 '--model_file',
230 type=str,
231 help="model file")
232 parser.add_argument(
233 '--params_file',
234 type=str,
235 help="params file")
236 parser.add_argument(
237 '--device',
238 type=str,
239 default='cpu',
240 help="cpu/gpu/hexagon/hta/apu")
241 parser.add_argument(
242 '--config',
243 type=str,
244 help="model config")
245 parser.add_argument(
246 "--no_obfuscate",
247 action="store_true",
248 help="obfuscate model names")
249 parser.add_argument(
250 "--gencode_model",
251 action="store_true",
252 help="generate model code")
253 parser.add_argument(
254 "--gencode_param",
255 action="store_true",
256 help="generate params code")
257 parser.add_argument(
258 '--output',
259 type=str,
260 default="build",
261 help="output dir")
262
263 flgs, _ = parser.parse_known_args()
264 mace_check(flgs.model_name not in CPP_KEYWORDS, "model name cannot be cpp"
265 "keywords")
266 return flgs
267
268
269def gen_mace_engine_factory(model_name, embed_model_data, output):

Callers 1

encrypt.pyFile · 0.70

Calls 1

mace_checkFunction · 0.90

Tested by

no test coverage detected