Update images.go

This commit is contained in:
Bruce MacDonald 2023-12-11 15:35:31 -05:00
parent 26d953f504
commit 823271d18d

View File

@ -417,7 +417,11 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars
// if the model is not in gguf format, pull the base model to try and get it in gguf format
if fromConfig.ModelFormat != "gguf" {
fn(api.ProgressResponse{Status: "updating base model"})
if err := PullModel(ctx, c.Args, &RegistryOptions{}, fn); err != nil {
parent, err := GetModel(c.Args)
if err != nil {
return err
}
if err := PullModel(ctx, parent.OriginalModel, &RegistryOptions{}, fn); err != nil {
log.Printf("error pulling model: %v", err)
}
// Reset the file pointer to the beginning of the file