From b060d7b62120dc2e419d052108f93e68cee2b4f4 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Mon, 29 Jan 2024 00:56:44 +1100 Subject: [PATCH] Update save.py --- unsloth/save.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/unsloth/save.py b/unsloth/save.py index 7190e10db6..c675d68366 100644 --- a/unsloth/save.py +++ b/unsloth/save.py @@ -591,6 +591,19 @@ def save_to_gguf( for line in sp.stderr: 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}") pass