fix: pull either original model or from model on create (#1774)
This commit is contained in:
parent
c0285158a9
commit
4ad6c9b11f
1 changed files with 8 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue