diff --git a/commands/df.go b/commands/df.go index 7e8ee551..c583c299 100644 --- a/commands/df.go +++ b/commands/df.go @@ -46,9 +46,9 @@ func diskUsageTable(df desktop.DiskUsage) string { }) table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) - table.Append([]string{"Models", units.HumanSize(float64(df.ModelsDiskUsage))}) + table.Append([]string{"Models", units.CustomSize("%.2f%s", float64(df.ModelsDiskUsage), 1000.0, []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"})}) if df.DefaultBackendDiskUsage != 0 { - table.Append([]string{"Inference engine", units.HumanSize(float64(df.DefaultBackendDiskUsage))}) + table.Append([]string{"Inference engine", units.CustomSize("%.2f%s", float64(df.DefaultBackendDiskUsage), 1000.0, []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"})}) } table.Render() diff --git a/desktop/desktop.go b/desktop/desktop.go index 2b43c329..d2259270 100644 --- a/desktop/desktop.go +++ b/desktop/desktop.go @@ -155,7 +155,7 @@ func (c *Client) Pull(model string, progress func(string)) (string, bool, error) current += layerCurrent } - progress(fmt.Sprintf("Downloaded %s of %s", units.HumanSize(float64(current)), units.HumanSize(float64(progressMsg.Total)))) + progress(fmt.Sprintf("Downloaded %s of %s", units.CustomSize("%.2f%s", float64(current), 1000.0, []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}), units.CustomSize("%.2f%s", float64(progressMsg.Total), 1000.0, []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}))) progressShown = true case "error": return "", progressShown, fmt.Errorf("error pulling model: %s", progressMsg.Message)