Squashed commit of the following:

commit 23bd794c246e9c90c453c9f2ab41a21ac1e41b9d
Author: Daniel Han-Chen <danielhanchen@gmail.com>
Date:   Fri May 17 14:16:39 2024 +1000

    Update save.py

commit c12cc6c2b13333c4c6709e0ee88665b08c672887
Author: Daniel Han-Chen <danielhanchen@gmail.com>
Date:   Fri May 17 04:14:05 2024 +1000

    peft issue
This commit is contained in:
Daniel Han-Chen 2024-05-17 14:18:52 +10:00
commit 0c2f3952b7

View file

@ -777,9 +777,10 @@ 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:
line = line.decode("utf-8", errors = "replace")
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 = "")
print(line, flush = True, end = "")
pass
pass
# Check if successful
@ -811,9 +812,10 @@ 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:
line = line.decode("utf-8", errors = "replace")
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 = "")
print(line, flush = True, end = "")
pass
pass
pass
@ -988,9 +990,10 @@ 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:
line = line.decode("utf-8", errors = "replace")
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 = "")
print(line, flush = True, end = "")
if sp.returncode is not None and sp.returncode != 0:
raise subprocess.CalledProcessError(sp.returncode, sp.args)
pass
@ -1031,9 +1034,10 @@ 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:
line = line.decode("utf-8", errors = "replace")
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 = "")
print(line, flush = True, end = "")
if sp.returncode is not None and sp.returncode != 0:
raise subprocess.CalledProcessError(sp.returncode, sp.args)
pass