From 1852755154a8f82cc2dcb01c37159340a55347ca Mon Sep 17 00:00:00 2001 From: Patrick Devine Date: Mon, 2 Oct 2023 14:34:52 -0700 Subject: [PATCH] show a default message when license/parameters/system prompt/template aren't specified (#681) --- cmd/cmd.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index c9ada036..f2431ae5 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -686,15 +686,31 @@ func generateInteractive(cmd *cobra.Command, model string) error { switch args[1] { case "license": - fmt.Println(resp.License) + if resp.License == "" { + fmt.Println("No license was specified for this model.\n") + } else { + fmt.Println(resp.License) + } case "modelfile": fmt.Println(resp.Modelfile) case "parameters": - fmt.Println(resp.Parameters) + if resp.Parameters == "" { + fmt.Println("No parameters were specified for this model.\n") + } else { + fmt.Println(resp.Parameters) + } case "system": - fmt.Println(resp.System) + if resp.System == "" { + fmt.Println("No system prompt was specified for this model.\n") + } else { + fmt.Println(resp.System) + } case "template": - fmt.Println(resp.Template) + if resp.Template == "" { + fmt.Println("No prompt template was specified for this model.\n") + } else { + fmt.Println(resp.Template) + } default: fmt.Printf("Unknown command '/show %s'. Type /? for help\n", args[1]) }