MCPcopy Index your code
hub / github.com/microsoft/BitNet / default_outfile

Function default_outfile

utils/convert.py:1476–1489  ·  view source on GitHub ↗
(model_paths: list[Path], file_type: GGMLFileType)

Source from the content-addressed store, hash-verified

1474
1475
1476def default_outfile(model_paths: list[Path], file_type: GGMLFileType) -> Path:
1477 namestr = {
1478 GGMLFileType.AllF32: "f32",
1479 GGMLFileType.MostlyF16: "f16",
1480 GGMLFileType.MostlyQ8_0:"q8_0",
1481 GGMLFileType.MostlyI2: "i2",
1482 }[file_type]
1483 ret = model_paths[0].parent / f"ggml-model-{namestr}.gguf"
1484 if ret in model_paths:
1485 logger.error(
1486 f"Error: Default output path ({ret}) would overwrite the input. "
1487 "Please explicitly specify a path using --outfile.")
1488 sys.exit(1)
1489 return ret
1490
1491
1492def do_dump_model(model_plus: ModelPlus) -> None:

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected