|
@@ -17,6 +17,7 @@ import (
|
|
|
"github.com/ollama/ollama/api"
|
|
|
"github.com/ollama/ollama/progress"
|
|
|
"github.com/ollama/ollama/readline"
|
|
|
+ "github.com/ollama/ollama/types/errtypes"
|
|
|
)
|
|
|
|
|
|
type MultilineState int
|
|
@@ -281,7 +282,10 @@ func generateInteractive(cmd *cobra.Command, opts runOptions) error {
|
|
|
fn := func(resp api.ProgressResponse) error { return nil }
|
|
|
err = client.Create(cmd.Context(), req, fn)
|
|
|
if err != nil {
|
|
|
- fmt.Println("error: couldn't save model")
|
|
|
+ if strings.Contains(err.Error(), errtypes.InvalidModelNameErrMsg) {
|
|
|
+ fmt.Printf("error: The model name '%s' is invalid\n", args[1])
|
|
|
+ continue
|
|
|
+ }
|
|
|
return err
|
|
|
}
|
|
|
fmt.Printf("Created new model '%s'\n", args[1])
|