"vscode:/vscode.git/clone" did not exist on "ec4c35fe99e5e5e02f38d94d310615828dd3a2c8"
Unverified Commit 24580df9 authored by Patrick Devine's avatar Patrick Devine Committed by GitHub
Browse files

only add a layer if there is actual data (#535)

parent 80dd44e8
...@@ -391,7 +391,7 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api ...@@ -391,7 +391,7 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api
return err return err
} }
// copie the model metadata // copy the model metadata
config.ModelFamily = source.ModelFamily config.ModelFamily = source.ModelFamily
config.ModelType = source.ModelType config.ModelType = source.ModelType
config.ModelFormat = source.ModelFormat config.ModelFormat = source.ModelFormat
...@@ -461,8 +461,10 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api ...@@ -461,8 +461,10 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api
return err return err
} }
if layer.Size > 0 {
layer.MediaType = mediaType layer.MediaType = mediaType
layers = append(layers, layer) layers = append(layers, layer)
}
case "template", "system", "prompt": case "template", "system", "prompt":
fn(api.ProgressResponse{Status: fmt.Sprintf("creating model %s layer", c.Name)}) fn(api.ProgressResponse{Status: fmt.Sprintf("creating model %s layer", c.Name)})
// remove the layer if one exists // remove the layer if one exists
...@@ -474,8 +476,10 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api ...@@ -474,8 +476,10 @@ func CreateModel(ctx context.Context, name string, path string, fn func(resp api
return err return err
} }
if layer.Size > 0 {
layer.MediaType = mediaType layer.MediaType = mediaType
layers = append(layers, layer) layers = append(layers, layer)
}
default: default:
// runtime parameters, build a list of args for each parameter to allow multiple values to be specified (ex: multiple stop sequences) // runtime parameters, build a list of args for each parameter to allow multiple values to be specified (ex: multiple stop sequences)
params[c.Name] = append(params[c.Name], c.Args) params[c.Name] = append(params[c.Name], c.Args)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment