From 13ffe22ca77678b6285e0b8f2a80563f57bc9496 Mon Sep 17 00:00:00 2001 From: Christian Zhou-Zheng Date: Thu, 6 Jun 2024 10:24:11 -0400 Subject: [PATCH] base-1024 bytes to base-1000 --- gguf-py/gguf/gguf_manager.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gguf-py/gguf/gguf_manager.py b/gguf-py/gguf/gguf_manager.py index f74b24117d149..fcf0ad8aa4e1c 100644 --- a/gguf-py/gguf/gguf_manager.py +++ b/gguf-py/gguf/gguf_manager.py @@ -232,11 +232,11 @@ def get_tensor_size(tensor) -> int: @staticmethod def split_str_to_n_bytes(split_str: str) -> int: if split_str.endswith("K"): - n = int(split_str[:-1]) * 1024 + n = int(split_str[:-1]) * 1000 elif split_str.endswith("M"): - n = int(split_str[:-1]) * 1024 * 1024 + n = int(split_str[:-1]) * 1000 * 1000 elif split_str.endswith("G"): - n = int(split_str[:-1]) * 1024 * 1024 * 1024 + n = int(split_str[:-1]) * 1000 * 1000 * 1000 elif split_str.isnumeric(): n = int(split_str) else: @@ -253,7 +253,7 @@ def format_n_bytes_to_str(num: int) -> str: return "negligible - metadata only" fnum = float(num) for unit in ("", "K", "M", "G"): - if abs(fnum) < 1024.0: + if abs(fnum) < 1000.0: return f"{fnum:3.1f}{unit}" - fnum /= 1024.0 + fnum /= 1000.0 return f"{fnum:.1f}T - over 1TB, --split recommended" \ No newline at end of file