Browse Source
fix: pull either original model or from model on create (#1774)
mattw/whatneedstorun
Bruce MacDonald
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
2 deletions
-
server/images.go
|
|
|
@ -485,9 +485,15 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
if err := PullModel(ctx, parent.OriginalModel, &RegistryOptions{}, fn); err != nil { |
|
|
|
log.Printf("error pulling model: %v", err) |
|
|
|
|
|
|
|
originalModel := parent.OriginalModel |
|
|
|
if originalModel == "" { |
|
|
|
originalModel = parent.ShortName |
|
|
|
} |
|
|
|
if err := PullModel(ctx, originalModel, &RegistryOptions{}, fn); err != nil { |
|
|
|
log.Printf("error pulling parent model: %v", err) |
|
|
|
} |
|
|
|
|
|
|
|
// Reset the file pointer to the beginning of the file
|
|
|
|
_, err = fromConfigFile.Seek(0, 0) |
|
|
|
if err != nil { |
|
|
|
|