From 815202f8329872205fecbb622ca0ed7fe9fb4a15 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Sat, 16 Mar 2024 20:03:51 +1100 Subject: [PATCH] GGUF --- unsloth/models/_utils.py | 2 ++ unsloth/save.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 95a032b698..02eea4ba0c 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -18,6 +18,8 @@ import warnings warnings.filterwarnings(action = "ignore", category = UserWarning, module = "torch") warnings.filterwarnings(action = "ignore", category = UserWarning, module = "huggingface_hub") warnings.filterwarnings(action = "ignore", category = RuntimeWarning, module = "subprocess") +warnings.filterwarnings(action = "ignore", category = UserWarning, module = "transformers") +warnings.filterwarnings(action = "ignore", category = FutureWarning, module = "accelerate") import bitsandbytes as bnb from transformers.models.llama.modeling_llama import logger from transformers import AutoTokenizer diff --git a/unsloth/save.py b/unsloth/save.py index 95fb413cb4..dcb67d2ce2 100644 --- a/unsloth/save.py +++ b/unsloth/save.py @@ -603,7 +603,7 @@ def install_llama_cpp_old(version = -10): for command in commands: with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, bufsize = 1) as sp: for line in sp.stdout: - print(line.decode("utf-8"), flush = True, end = "") + print(line.decode("utf-8", errors = "replace"), flush = True, end = "") pass pass # Check if successful @@ -626,7 +626,7 @@ def install_llama_cpp_blocking(): for command in commands: with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, bufsize = 1) as sp: for line in sp.stdout: - print(line.decode("utf-8"), flush = True, end = "") + print(line.decode("utf-8", errors = "replace"), flush = True, end = "") pass pass pass @@ -731,7 +731,7 @@ def save_to_gguf( with subprocess.Popen(command, shell = True, stdout = subprocess.PIPE, stderr = subprocess.PIPE, bufsize = 1) as sp: for line in sp.stdout: - print(line.decode("utf-8"), flush = True, end = "") + 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) pass @@ -761,7 +761,7 @@ def save_to_gguf( # quantize uses stderr with subprocess.Popen(command, shell = True, stderr = subprocess.PIPE, bufsize = 1) as sp: for line in sp.stderr: - print(line.decode("utf-8"), flush = True, end = "") + 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) pass