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

Function build_model

examples/models/llama/export_llama_lib.py:160–171  ·  view source on GitHub ↗
(
    model: str,
    checkpoint: str,
    params: str,
    output_dir: Optional[str] = ".",
    extra_opts: Optional[str] = "",
)

Source from the content-addressed store, hash-verified

158
159
160def build_model(
161 model: str,
162 checkpoint: str,
163 params: str,
164 output_dir: Optional[str] = ".",
165 extra_opts: Optional[str] = "",
166) -> str:
167 argString = f"--model {model} --checkpoint {checkpoint} --params {params} {extra_opts} --output-dir {output_dir}"
168 parser = build_args_parser()
169 args = parser.parse_args(shlex.split(argString))
170 llm_config = LlmConfig.from_args(args)
171 return export_llama(llm_config)
172
173
174def parse_list_of_ints(s):

Callers

nothing calls this directly

Calls 4

splitMethod · 0.80
from_argsMethod · 0.80
build_args_parserFunction · 0.70
export_llamaFunction · 0.70

Tested by

no test coverage detected