fix: pull either original model or from model on create (#1774)

This commit is contained in:
Bruce MacDonald 2024-01-04 01:34:38 -05:00 committed by GitHub
parent c0285158a9
commit 4ad6c9b11f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {