From 460de24ea2f2c2e03c120453469e54b388ddcc44 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Mon, 29 Jan 2024 00:57:11 +1100 Subject: [PATCH] Update save.py --- unsloth/save.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/unsloth/save.py b/unsloth/save.py index c675d68366..4fa03b91d4 100644 --- a/unsloth/save.py +++ b/unsloth/save.py @@ -576,6 +576,17 @@ def save_to_gguf( print(line.decode("utf-8"), flush = True, end = "") pass + # Check if quantization succeeded! + if not os.path.isfile(final_location): + raise RuntimeError( + "Unsloth: Quantization failed! You might have to compile llama.cpp yourself, then run this again.\n"\ + "You do not need to close this Python program. Run the following commands in a new terminal:\n"\ + "You must run this in the same folder as you're saving your model.\n"\ + "git clone https://github.com/ggerganov/llama.cpp\n"\ + "cd llama.cpp && make clean && LLAMA_CUBLAS=1 make -j\n"\, + "Once that's done, redo the quantization." + ) + pass print(f"Unsloth: Conversion completed! Output location: {final_location}") if quantization_method != first_conversion: @@ -603,7 +614,7 @@ def save_to_gguf( "Once that's done, redo the quantization." ) pass - + print(f"Unsloth: Conversion completed! Output location: {final_location}") pass