From bb80a597dbb3dcdcb8465d7813aa4fe3905a4be2 Mon Sep 17 00:00:00 2001 From: Joshua Pham Date: Fri, 1 Dec 2023 13:50:55 -0500 Subject: [PATCH] Fix adapter loading from SHA hash --- server/images.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/images.go b/server/images.go index 74c2107cc..294fdf2b7 100644 --- a/server/images.go +++ b/server/images.go @@ -375,6 +375,15 @@ func CreateModel(ctx context.Context, name, modelFileDir string, commands []pars layer.MediaType = mediatype layers = append(layers, layer) 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"}) bin, err := os.Open(realpath(modelFileDir, c.Args)) if err != nil {