Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
replace go-humanize with format.HumanBytes
Michael Yang01ea6002c49e
diff --git a/cmd/cmd.go b/cmd/cmd.goindex d78395587..8fc6e4c4c 100644--- a/cmd/cmd.go+++ b/cmd/cmd.go@@ -20,7 +20,6 @@ import ("syscall""time"- "github.com/dustin/go-humanize""github.com/olekukonko/tablewriter""github.com/spf13/cobra""golang.org/x/crypto/ssh"@@ -173,7 +172,7 @@ func ListHandler(cmd *cobra.Command, args []string) error {for _, m := range models.Models {if len(args) == 0 || strings.HasPrefix(m.Name, args[0]) {- data = append(data, []string{m.Name, m.Digest[:12], humanize.Bytes(uint64(m.Size)), format.HumanTime(m.ModifiedAt, "Never")})+ data = append(data, []string{m.Name, m.Digest[:12], format.HumanBytes(m.Size), format.HumanTime(m.ModifiedAt, "Never")})}}diff --git a/format/bytes.go b/format/bytes.goindex ca5ac6405..1cf5a7628 100644--- a/format/bytes.go+++ b/format/bytes.go@@ -12,11 +12,11 @@ const (func HumanBytes(b int64) string {switch {case b > GigaByte:- return fmt.Sprintf("%d GB", b/GigaByte)+ return fmt.Sprintf("%.1f GB", float64(b)/GigaByte)case b > MegaByte:- return fmt.Sprintf("%d MB", b/MegaByte)+ return fmt.Sprintf("%.1f MB", float64(b)/MegaByte)case b > KiloByte:- return fmt.Sprintf("%d KB", b/KiloByte)+ return fmt.Sprintf("%.1f KB", float64(b)/KiloByte)default:return fmt.Sprintf("%d B", b)}diff --git a/go.mod b/go.modindex b0f117bd1..6d4c629ad 100644--- a/go.mod+++ b/go.mod@@ -3,7 +3,6 @@ module github.com/jmorganca/ollamago 1.20require (- github.com/dustin/go-humanize v1.0.1github.com/emirpasic/gods v1.18.1github.com/gin-gonic/gin v1.9.1github.com/mattn/go-runewidth v0.0.14diff --git a/go.sum b/go.sumindex 0b94adbc3..dab05d3db 100644--- a/go.sum+++ b/go.sum@@ -9,8 +9,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=-github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=-github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=