fix model loading
This commit is contained in:
parent
b883c895d5
commit
cea61b0434
18
cmd/cmd.go
18
cmd/cmd.go
|
|
@ -446,19 +446,17 @@ func RunHandler(cmd *cobra.Command, args []string) error {
|
||||||
opts.ParentModel = info.Details.ParentModel
|
opts.ParentModel = info.Details.ParentModel
|
||||||
|
|
||||||
if interactive {
|
if interactive {
|
||||||
if len(info.Messages) > 0 {
|
if err := loadOrUnloadModel(cmd, &opts); err != nil {
|
||||||
if err := loadOrUnloadModel(cmd, &opts); err != nil {
|
var sErr api.AuthorizationError
|
||||||
var sErr api.AuthorizationError
|
if errors.As(err, &sErr) && sErr.StatusCode == http.StatusUnauthorized {
|
||||||
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")
|
||||||
fmt.Printf("You need to be signed in to Ollama to run Cloud models.\n\n")
|
|
||||||
|
|
||||||
if sErr.SigninURL != "" {
|
if sErr.SigninURL != "" {
|
||||||
fmt.Printf(ConnectInstructions, sErr.SigninURL)
|
fmt.Printf(ConnectInstructions, sErr.SigninURL)
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, msg := range info.Messages {
|
for _, msg := range info.Messages {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue