diff --git a/cmd/cmd.go b/cmd/cmd.go index 68197f72d..3ac4a3e15 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -656,7 +656,7 @@ func ShowHandler(cmd *cobra.Command, args []string) error { modelData := [][]string{ {"arch", arch}, - {"parameters", resp.Details.ParameterSize}, + {"parameters", format.HumanNumber(uint64(resp.ModelInfo["general.parameter_count"].(float64)))}, {"quantization", resp.Details.QuantizationLevel}, {"context length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.context_length", arch)].(float64))}, {"embedding length", fmt.Sprintf("%v", resp.ModelInfo[fmt.Sprintf("%s.embedding_length", arch)].(float64))}, diff --git a/format/format.go b/format/format.go index 31059578f..d233240f7 100644 --- a/format/format.go +++ b/format/format.go @@ -18,7 +18,7 @@ func HumanNumber(b uint64) string { if number == math.Floor(number) { return fmt.Sprintf("%.0fB", number) // no decimals if whole number } - return fmt.Sprintf("%.1fB", number) // one decimal if not a whole number + return fmt.Sprintf("%.2fB", number) // two decimals if not a whole number case b >= Million: number := float64(b) / Million if number == math.Floor(number) { diff --git a/format/format_test.go b/format/format_test.go index bff327803..a02cb3c2c 100644 --- a/format/format_test.go +++ b/format/format_test.go @@ -17,8 +17,8 @@ func TestHumanNumber(t *testing.T) { {500500000, "500.50M"}, {500550000, "500.55M"}, {1000000000, "1B"}, - {2800000000, "2.8B"}, - {2850000000, "2.9B"}, + {2800000000, "2.80B"}, + {2850000000, "2.85B"}, {1000000000000, "1000B"}, }