Update save.py

This commit is contained in:
Daniel Han-Chen 2024-01-29 00:56:44 +11:00
commit b060d7b621

View file

@ -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