From 6879fb501f1816eecb78c7e1daf741d50f2a0e27 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Sat, 29 Jun 2024 06:26:29 +0200 Subject: [PATCH] squash! convert-hf : print output file name when completed Updates the output of to support printing the directory if the output is split into multiple files. Also the output file name is now retrieved from the model_instance object. Signed-off-by: Daniel Bevenius --- convert-hf-to-gguf.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index 3c974ae09..985fbff5d 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -3091,7 +3091,8 @@ def main() -> None: "auto": gguf.LlamaFileType.GUESSED, } - if args.use_temp_file and (args.split_max_tensors > 0 or args.split_max_size != "0"): + is_split = args.split_max_tensors > 0 or args.split_max_size != "0" + if args.use_temp_file and is_split: logger.error("Error: Cannot use temp file when splitting") sys.exit(1) @@ -3128,11 +3129,12 @@ def main() -> None: if args.vocab_only: logger.info("Exporting model vocab...") model_instance.write_vocab() - logger.info(f"Model vocab successfully exported to {fname_out}.") + logger.info(f"Model vocab successfully exported to {model_instance.fname_out}") else: logger.info("Exporting model...") model_instance.write() - logger.info(f"Model successfully exported to {fname_out}.") + out_path = os.path.dirname(model_instance.fname_out) + '/' if is_split else model_instance.fname_out + logger.info(f"Model successfully exported to {out_path}") if __name__ == '__main__':