Skip to content

Commit f2099c5

Browse files
committed
convert-hf : align the message logged for converted tensors
1 parent 98f2d0e commit f2099c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

convert-hf-to-gguf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ def extra_f16_tensors(self, name: str, new_name: str, bid: int | None, n_dims: i
189189
return False
190190

191191
def write_tensors(self):
192+
max_name_len = max(len(s) for _, s in self.tensor_map.mapping.values()) + len(".weight,")
193+
192194
for name, data_torch in self.tensors.items():
193195
# we don't need these
194196
if name.endswith((".attention.masked_bias", ".attention.bias", ".rotary_emb.inv_freq")):
@@ -237,7 +239,7 @@ def write_tensors(self):
237239
shape_str = f"{{{', '.join(str(n) for n in reversed(data.shape))}}}"
238240

239241
# n_dims is implicit in the shape
240-
logger.info(f"{new_name}, shape = {shape_str}, {old_dtype} --> {data.dtype}")
242+
logger.info(f"{f'%-{max_name_len}s' % f'{new_name},'} {old_dtype} --> {data.dtype}, shape = {shape_str}")
241243

242244
self.gguf_writer.add_tensor(new_name, data)
243245

0 commit comments

Comments
 (0)