Skip to content

Commit

Permalink
convert-hf-to-gguf.py: add additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mofosyne committed Apr 21, 2024
1 parent 81a9d17 commit a6f54de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions convert-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand Down

0 comments on commit a6f54de

Please sign in to comment.