From 8abac6dfa371f4baed35a9c4dd4b721500a14d5b Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Tue, 19 Mar 2024 02:45:20 +1100 Subject: [PATCH] Update save.py --- unsloth/save.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/unsloth/save.py b/unsloth/save.py index 166f7fd365..ec5b552909 100644 --- a/unsloth/save.py +++ b/unsloth/save.py @@ -687,13 +687,16 @@ def install_llama_cpp_old(version = -10): pass -def install_llama_cpp_blocking(): +def install_llama_cpp_blocking(use_cuda = True): + use_cuda = "LLAMA_CUBLAS=1" if use_cuda else "" + commands = [ "git clone https://github.com/ggerganov/llama.cpp", - f"cd llama.cpp && make clean && LLAMA_CUBLAS=1 make all -j{psutil.cpu_count()*2}", + f"cd llama.cpp && make clean && {use_cuda} make all -j{psutil.cpu_count()*2}", "pip install gguf protobuf", ] if os.path.exists("llama.cpp"): return + for command in commands: with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, bufsize = 1) as sp: for line in sp.stdout: