diff --git a/cmd/interactive.go b/cmd/interactive.go index a285b365c0..08ab4947bc 100644 --- a/cmd/interactive.go +++ b/cmd/interactive.go @@ -385,18 +385,21 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error { case "modelfile": fmt.Println(resp.Modelfile) case "parameters": + fmt.Println("Model defined parameters:") if resp.Parameters == "" { - fmt.Println("No parameters were specified for this model.") + fmt.Println(" No additional parameters were specified for this model.") } else { - if len(opts.Options) > 0 { - fmt.Println("User defined parameters:") - for k, v := range opts.Options { - fmt.Printf("%-*s %v\n", 30, k, v) - } - fmt.Println() + for _, l := range strings.Split(resp.Parameters, "\n") { + fmt.Printf(" %s\n", l) } - fmt.Println("Model defined parameters:") - fmt.Println(resp.Parameters) + } + fmt.Println() + if len(opts.Options) > 0 { + fmt.Println("User defined parameters:") + for k, v := range opts.Options { + fmt.Printf(" %-*s %v\n", 30, k, v) + } + fmt.Println() } case "system": switch { diff --git a/server/routes.go b/server/routes.go index 603cd42a25..40348e7370 100644 --- a/server/routes.go +++ b/server/routes.go @@ -842,8 +842,11 @@ func GetModelInfo(req api.ShowRequest) (*api.ShowResponse, error) { } resp.Parameters = strings.Join(params, "\n") - for k, v := range req.Options { - if _, ok := req.Options[k]; ok { + if len(req.Options) > 0 { + if m.Options == nil { + m.Options = make(map[string]any) + } + for k, v := range req.Options { m.Options[k] = v } }