Roy Han преди 11 месеца
родител
ревизия
af370ac178
променени са 3 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 1 1
      cmd/cmd.go
  2. 1 1
      format/format.go
  3. 2 2
      format/format_test.go

+ 1 - 1
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))},

+ 1 - 1
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) {

+ 2 - 2
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"},
 	}