From 133097d995e7cb7046c79a6c4d5b7b7a76a4d2c4 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Mon, 11 Mar 2024 02:25:10 +1100 Subject: [PATCH] Update save.py --- unsloth/save.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/unsloth/save.py b/unsloth/save.py index d1a00e189a..7543eef10e 100644 --- a/unsloth/save.py +++ b/unsloth/save.py @@ -577,6 +577,21 @@ def install_llama_cpp_old(version = -10): latest = releases[-1] version = releases[version].split(" ")[0] + # Check if the llama.cpp exists + if os.path.exists("llama.cpp"): + print( + "**[WARNING]** You have a llama.cpp old directory which is broken.\n"\ + "Unsloth will DELETE the broken directory and install a new one.\n"\ + "Press CTRL + C / cancel this if this is wrong. We shall wait 10 seconds.\n" + ) + import time + for i in range(10): + print(f"**[WARNING]** Deleting llama.cpp directory... {10-i} seconds left.") + time.sleep(1) + import shutil + shutil.rmtree("llama.cpp") + pass + # Clone a specific commit commands = [ "git clone https://github.com/ggerganov/llama.cpp",