| 1166 | |
| 1167 | |
| 1168 | def default_outfile(model_paths: list[Path], file_type: GGMLFileType) -> Path: |
| 1169 | namestr = { |
| 1170 | GGMLFileType.AllF32: "f32", |
| 1171 | GGMLFileType.MostlyF16: "f16", |
| 1172 | GGMLFileType.MostlyQ8_0:"q8_0", |
| 1173 | }[file_type] |
| 1174 | ret = model_paths[0].parent / f"ggml-model-{namestr}.gguf" |
| 1175 | if ret in model_paths: |
| 1176 | sys.stderr.write( |
| 1177 | f"Error: Default output path ({ret}) would overwrite the input. " |
| 1178 | "Please explicitly specify a path using --outfile.\n") |
| 1179 | sys.exit(1) |
| 1180 | return ret |
| 1181 | |
| 1182 | |
| 1183 | def do_dump_model(model_plus: ModelPlus) -> None: |