From a6f54dee3ca65ae1dbeab3f8c26c1d75a9609715 Mon Sep 17 00:00:00 2001 From: brian khuu Date: Sun, 21 Apr 2024 11:33:27 +1000 Subject: [PATCH] convert-hf-to-gguf.py: add additional logging --- convert-hf-to-gguf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index 3d7076a55dba52..2edcfffad51fdd 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -2645,8 +2645,7 @@ def write_tensors(self): # map tensor names new_name = tensor_map.get_name(name, try_suffixes=(".weight", ".bias")) if new_name is None: - print(f"Can not map tensor {name!r}") - sys.exit() + raise ValueError(f"Can not map tensor {name!r}") n_dims = len(data.shape) data_dtype = data.dtype @@ -2663,7 +2662,7 @@ def write_tensors(self): if self.ftype == 1 and data_dtype == np.float32 and n_dims == 2: data = data.astype(np.float16) - print(f"{new_name}, n_dims = {n_dims}, {old_dtype} --> {data.dtype}") + logger.info(f"{new_name}, n_dims = {n_dims}, {old_dtype} --> {data.dtype}") self.gguf_writer.add_tensor(new_name, data)