only pull gguf model if already exists (#1817)
This commit is contained in:
parent
9c2941e61b
commit
3a9f447141
1 changed files with 13 additions and 12 deletions
|
@ -158,9 +158,9 @@ func RunHandler(cmd *cobra.Command, args []string) error {
|
||||||
}
|
}
|
||||||
case err != nil:
|
case err != nil:
|
||||||
return err
|
return err
|
||||||
}
|
default:
|
||||||
|
// the model was found, check if it is in the correct format
|
||||||
if model.Details.Format != "gguf" {
|
if model.Details.Format != "" && model.Details.Format != "gguf" {
|
||||||
// pull and retry to see if the model has been updated
|
// pull and retry to see if the model has been updated
|
||||||
parts := strings.Split(name, string(os.PathSeparator))
|
parts := strings.Split(name, string(os.PathSeparator))
|
||||||
if len(parts) == 1 {
|
if len(parts) == 1 {
|
||||||
|
@ -172,6 +172,7 @@ func RunHandler(cmd *cobra.Command, args []string) error {
|
||||||
return fmt.Errorf("unsupported model, please update this model to gguf format") // relay the original error
|
return fmt.Errorf("unsupported model, please update this model to gguf format") // relay the original error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return RunGenerate(cmd, args)
|
return RunGenerate(cmd, args)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue