Skip to content

Commit

Permalink
fix error on ollama run with a non-existent model
Browse files Browse the repository at this point in the history
  • Loading branch information
jmorganca committed Feb 2, 2024
1 parent e135167 commit 09a6f76
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func RunHandler(cmd *cobra.Command, args []string) error {
}

name := args[0]

// check if the model exists on the server
show, err := client.Show(cmd.Context(), &api.ShowRequest{Name: name})
var statusError api.StatusError
Expand All @@ -155,6 +156,11 @@ func RunHandler(cmd *cobra.Command, args []string) error {
if err := PullHandler(cmd, []string{name}); err != nil {
return err
}

show, err = client.Show(cmd.Context(), &api.ShowRequest{Name: name})
if err != nil {
return err
}
case err != nil:
return err
}
Expand Down

0 comments on commit 09a6f76

Please sign in to comment.