Skip to content

Commit

Permalink
Revert "cmd: provide feedback if OLLAMA_MODELS is set on non-serve co…
Browse files Browse the repository at this point in the history
…mmand (ollama#3470)" (ollama#3662)

This reverts commit 7d05a6e.

This proved to be more painful than useful.

See: ollama#3624
  • Loading branch information
bmizerany authored Apr 15, 2024
1 parent 99d227c commit 949d783
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,6 @@ func createBlob(cmd *cobra.Command, client *api.Client, path string) (string, er
}

func RunHandler(cmd *cobra.Command, args []string) error {
if os.Getenv("OLLAMA_MODELS") != "" {
return errors.New("OLLAMA_MODELS must only be set for 'ollama serve'")
}

if err := checkServerHeartbeat(cmd, args); err != nil {
return err
}

client, err := api.ClientFromEnvironment()
if err != nil {
return err
Expand Down Expand Up @@ -986,10 +978,11 @@ func NewCLI() *cobra.Command {
showCmd.Flags().Bool("system", false, "Show system message of a model")

runCmd := &cobra.Command{
Use: "run MODEL [PROMPT]",
Short: "Run a model",
Args: cobra.MinimumNArgs(1),
RunE: RunHandler,
Use: "run MODEL [PROMPT]",
Short: "Run a model",
Args: cobra.MinimumNArgs(1),
PreRunE: checkServerHeartbeat,
RunE: RunHandler,
}

runCmd.Flags().Bool("verbose", false, "Show timings for response")
Expand Down

0 comments on commit 949d783

Please sign in to comment.