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

Function gen_mace_engine_factory

tools/python/encrypt.py:269–282  ·  view source on GitHub ↗
(model_name, embed_model_data, output)

Source from the content-addressed store, hash-verified

267
268
269def gen_mace_engine_factory(model_name, embed_model_data, output):
270 util.mkdir_p(output)
271 cwd = os.path.dirname(__file__)
272 j2_env = Environment(
273 loader=FileSystemLoader(cwd + "/template"), trim_blocks=True)
274 # generate mace_run BUILD file
275 template_name = 'mace_engine_factory.h.jinja2'
276 model_name = list(model_name)
277 source = j2_env.get_template(template_name).render(
278 model_tags=model_name,
279 embed_model_data=embed_model_data,
280 )
281 with open(output + '/mace_engine_factory.h', "w") as f:
282 f.write(source)
283
284
285if __name__ == '__main__':

Callers 1

encrypt.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected