Updated formatting

This commit is contained in:
origamiman72 committed 2022-07-24 02:13:47 -07:00
1 parent 66d23199ff
commit 27b8d94f84
1 file changed
+2 -2
+2 -2
View File
@@ -21,9 +21,9 @@ import json
from pydoc import locate
from typing import Any, Dict
from math import floor, log
import torch
from omegaconf import DictConfig
from math import floor, log
class DotDict(dict):
@@ -98,4 +98,4 @@ def human_format(num):
units = ["", "K", "M", "B", "T", "P"]
k = 1000.0
magnitude = int(floor(log(num, k)))
return "%.2f %s" % (num / k**magnitude, units[magnitude])
return f"{(num / k**magnitude):.2f} {units[magnitude]}"