From cea61b043497cfe0f0376f1098679cd893ad4254 Mon Sep 17 00:00:00 2001 From: ParthSareen Date: Fri, 24 Oct 2025 15:03:39 -0700 Subject: [PATCH] fix model loading --- cmd/cmd.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index fc3c54750..4368963ca 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -446,19 +446,17 @@ func RunHandler(cmd *cobra.Command, args []string) error { opts.ParentModel = info.Details.ParentModel if interactive { - if len(info.Messages) > 0 { - if err := loadOrUnloadModel(cmd, &opts); err != nil { - var sErr api.AuthorizationError - if errors.As(err, &sErr) && sErr.StatusCode == http.StatusUnauthorized { - fmt.Printf("You need to be signed in to Ollama to run Cloud models.\n\n") + if err := loadOrUnloadModel(cmd, &opts); err != nil { + var sErr api.AuthorizationError + if errors.As(err, &sErr) && sErr.StatusCode == http.StatusUnauthorized { + fmt.Printf("You need to be signed in to Ollama to run Cloud models.\n\n") - if sErr.SigninURL != "" { - fmt.Printf(ConnectInstructions, sErr.SigninURL) - } - return nil + if sErr.SigninURL != "" { + fmt.Printf(ConnectInstructions, sErr.SigninURL) } - return err + return nil } + return err } for _, msg := range info.Messages {