Commit bb80a597 authored by Joshua Pham's avatar Joshua Pham
Browse files

Fix adapter loading from SHA hash

parent 6681d378
...@@ -375,6 +375,15 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars ...@@ -375,6 +375,15 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars
layer.MediaType = mediatype layer.MediaType = mediatype
layers = append(layers, layer) layers = append(layers, layer)
case "adapter": case "adapter":
if strings.HasPrefix(c.Args, "@") {
blobPath, err := GetBlobsPath(strings.TrimPrefix(c.Args, "@"))
if err != nil {
return err
}
c.Args = blobPath
}
fn(api.ProgressResponse{Status: "creating adapter layer"}) fn(api.ProgressResponse{Status: "creating adapter layer"})
bin, err := os.Open(realpath(modelFileDir, c.Args)) bin, err := os.Open(realpath(modelFileDir, c.Args))
if err != nil { if err != nil {
......
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