type consistency in format_n_bytes_to_str
This commit is contained in:
parent
3328b0a991
commit
1cbab22225
1 changed files with 5 additions and 5 deletions
|
@ -255,9 +255,9 @@ class GGUFManager(GGUFWriter):
|
||||||
def format_n_bytes_to_str(num: int) -> str:
|
def format_n_bytes_to_str(num: int) -> str:
|
||||||
if num == METADATA_ONLY_INDICATOR:
|
if num == METADATA_ONLY_INDICATOR:
|
||||||
return "negligible - metadata only"
|
return "negligible - metadata only"
|
||||||
num = float(num)
|
fnum = float(num)
|
||||||
for unit in ("", "K", "M", "G"):
|
for unit in ("", "K", "M", "G"):
|
||||||
if abs(num) < 1024.0:
|
if abs(fnum) < 1024.0:
|
||||||
return f"{num:3.1f}{unit}"
|
return f"{fnum:3.1f}{unit}"
|
||||||
num /= 1024.0
|
fnum /= 1024.0
|
||||||
return f"{num:.1f}T - over 1TB, --split recommended"
|
return f"{fnum:.1f}T - over 1TB, --split recommended"
|
Loading…
Add table
Add a link
Reference in a new issue