From f2099c50ab1cd21ed746264daad9538f754a31db Mon Sep 17 00:00:00 2001 From: Francis Couture-Harpin Date: Sat, 4 May 2024 09:09:47 -0400 Subject: [PATCH] convert-hf : align the message logged for converted tensors --- convert-hf-to-gguf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index 7f1fceab4..8750c1671 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -189,6 +189,8 @@ class Model: return False def write_tensors(self): + max_name_len = max(len(s) for _, s in self.tensor_map.mapping.values()) + len(".weight,") + for name, data_torch in self.tensors.items(): # we don't need these if name.endswith((".attention.masked_bias", ".attention.bias", ".rotary_emb.inv_freq")): @@ -237,7 +239,7 @@ class Model: shape_str = f"{{{', '.join(str(n) for n in reversed(data.shape))}}}" # n_dims is implicit in the shape - logger.info(f"{new_name}, shape = {shape_str}, {old_dtype} --> {data.dtype}") + logger.info(f"{f'%-{max_name_len}s' % f'{new_name},'} {old_dtype} --> {data.dtype}, shape = {shape_str}") self.gguf_writer.add_tensor(new_name, data)