From 3173a62eb9f90b94fb3184131032c1c8b7aa8d86 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sun, 16 Apr 2023 13:58:48 +0300 Subject: stdout : vertical align outputs for better readibility --- convert.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'convert.py') diff --git a/convert.py b/convert.py index 4e28a45e..7b9f043b 100644 --- a/convert.py +++ b/convert.py @@ -951,8 +951,9 @@ class OutputFile: ndarrays = bounded_parallel_map(do_item, model.items(), concurrency=8) for i, ((name, lazy_tensor), ndarray) in enumerate(zip(model.items(), ndarrays)): - size = ' x '.join(map(str, lazy_tensor.shape)) - print(f"[{i+1}/{len(model)}] Writing tensor {name}, size {size}...") + size = ' x '.join(f"{dim:6d}" for dim in lazy_tensor.shape) + padi = len(str(len(model))) + print(f"[{i+1:{padi}d}/{len(model)}] Writing tensor {name:38s} | size {size:16} | type {lazy_tensor.data_type}") of.write_tensor_header(name, lazy_tensor.shape, lazy_tensor.data_type) ndarray.tofile(of.fout) of.fout.close() -- cgit v1.2.3