diff --git a/cmd/cmd.go b/cmd/cmd.go index debb3921..c898c7db 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -624,13 +624,13 @@ func ShowHandler(cmd *cobra.Command, args []string) error { return errors.New("only one of '--license', '--modelfile', '--parameters', '--system', or '--template' can be specified") } - if flagsSet == 1 { - req := api.ShowRequest{Name: args[0]} - resp, err := client.Show(cmd.Context(), &req) - if err != nil { - return err - } + req := api.ShowRequest{Name: args[0]} + resp, err := client.Show(cmd.Context(), &req) + if err != nil { + return err + } + if flagsSet == 1 { switch showType { case "license": fmt.Println(resp.License) @@ -647,12 +647,12 @@ func ShowHandler(cmd *cobra.Command, args []string) error { return nil } - req := api.ShowRequest{Name: args[0]} - resp, err := client.Show(cmd.Context(), &req) - if err != nil { - return err - } + showInfo(resp) + return nil +} + +func showInfo(resp *api.ShowResponse) { arch := resp.ModelInfo["general.architecture"].(string) modelData := [][]string{ @@ -711,8 +711,6 @@ func ShowHandler(cmd *cobra.Command, args []string) error { } table.Render() - - return nil } func renderSubTable(data [][]string, file bool) string { diff --git a/cmd/interactive.go b/cmd/interactive.go index 0a2f429b..9214f2db 100644 --- a/cmd/interactive.go +++ b/cmd/interactive.go @@ -404,15 +404,7 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error { switch args[1] { case "info": - fmt.Println("Model details:") - if len(resp.Details.Families) > 0 { - fmt.Printf("Family %s\n", strings.Join(resp.Details.Families, ", ")) - } else if resp.Details.Family != "" { - fmt.Printf("Family %s\n", resp.Details.Family) - } - fmt.Printf("Parameter Size %s\n", resp.Details.ParameterSize) - fmt.Printf("Quantization Level %s\n", resp.Details.QuantizationLevel) - fmt.Println("") + showInfo(resp) case "license": if resp.License == "" { fmt.Println("No license was specified for this model.")