diff --git a/pyproject.toml b/pyproject.toml index 0398d0df4c..91654e68a4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ huggingface = [ "numpy", "accelerate>=0.26.1", "trl>=0.7.9", - "peft>=0.7.1", + "peft>=0.7.1,<0.11.0", "protobuf<4.0.0", ] cu118only = [ diff --git a/unsloth/save.py b/unsloth/save.py index 39b18d0dd9..caa5aaa619 100644 --- a/unsloth/save.py +++ b/unsloth/save.py @@ -777,6 +777,8 @@ def install_llama_cpp_old(version = -10): for command in commands: with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, bufsize = 1) as sp: for line in sp.stdout: + if "undefined reference" in line: + raise RuntimeError("Failed compiling llama.cpp. Please report this ASAP!") print(line.decode("utf-8", errors = "replace"), flush = True, end = "") pass pass @@ -809,6 +811,8 @@ def install_llama_cpp_blocking(use_cuda = True): for command in commands: with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, bufsize = 1) as sp: for line in sp.stdout: + if "undefined reference" in line: + raise RuntimeError("Failed compiling llama.cpp. Please report this ASAP!") print(line.decode("utf-8", errors = "replace"), flush = True, end = "") pass pass @@ -984,6 +988,8 @@ def save_to_gguf( with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, bufsize = 1) as sp: for line in sp.stdout: + if "undefined reference" in line: + raise RuntimeError("Failed compiling llama.cpp. Please report this ASAP!") print(line.decode("utf-8", errors = "replace"), flush = True, end = "") if sp.returncode is not None and sp.returncode != 0: raise subprocess.CalledProcessError(sp.returncode, sp.args) @@ -1025,6 +1031,8 @@ def save_to_gguf( # quantize uses stderr with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, bufsize = 1) as sp: for line in sp.stdout: + if "undefined reference" in line: + raise RuntimeError("Failed compiling llama.cpp. Please report this ASAP!") print(line.decode("utf-8", errors = "replace"), flush = True, end = "") if sp.returncode is not None and sp.returncode != 0: raise subprocess.CalledProcessError(sp.returncode, sp.args)