Merge pull request #1347 from jshph/adapter-hash

Fix adapter loading from SHA hash
This commit is contained in:
Michael Yang 2023-12-01 11:08:25 -08:00 committed by GitHub
commit cedae0d17a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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