diff --git a/gguf-py/gguf/gguf_manager.py b/gguf-py/gguf/gguf_manager.py index e7d2ef096cd49..523a5f500a466 100644 --- a/gguf-py/gguf/gguf_manager.py +++ b/gguf-py/gguf/gguf_manager.py @@ -255,9 +255,9 @@ def split_str_to_n_bytes(split_str: str) -> int: def format_n_bytes_to_str(num: int) -> str: if num == METADATA_ONLY_INDICATOR: return "negligible - metadata only" - num = float(num) + fnum = float(num) for unit in ("", "K", "M", "G"): - if abs(num) < 1024.0: - return f"{num:3.1f}{unit}" - num /= 1024.0 - return f"{num:.1f}T - over 1TB, --split recommended" \ No newline at end of file + if abs(fnum) < 1024.0: + return f"{fnum:3.1f}{unit}" + fnum /= 1024.0 + return f"{fnum:.1f}T - over 1TB, --split recommended" \ No newline at end of file