| 1100 | |
| 1101 | |
| 1102 | def 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 | |
| 1117 | def do_dump_model(model_plus: ModelPlus) -> None: |