MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / default_outfile

Function default_outfile

convert-dense.py:1102–1114  ·  view source on GitHub ↗
(model_paths: list[Path], file_type: GGMLFileType)

Source from the content-addressed store, hash-verified

1100
1101
1102def default_outfile(model_paths: list[Path], file_type: GGMLFileType) -> Path:
1103 namestr = {
1104 GGMLFileType.AllF32: "f32",
1105 GGMLFileType.MostlyF16: "f16",
1106 GGMLFileType.MostlyQ8_0:"q8_0",
1107 }[file_type]
1108 ret = model_paths[0].parent / f"ggml-model-{namestr}.gguf"
1109 if ret in model_paths:
1110 sys.stderr.write(
1111 f"Error: Default output path ({ret}) would overwrite the input. "
1112 "Please explicitly specify a path using --outfile.\n")
1113 sys.exit(1)
1114 return ret
1115
1116
1117def do_dump_model(model_plus: ModelPlus) -> None:

Callers 1

mainFunction · 0.70

Calls 2

exitMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected