Skip to content

Commit

Permalink
Merge pull request ollama#1347 from jshph/adapter-hash
Browse files Browse the repository at this point in the history
Fix adapter loading from SHA hash
  • Loading branch information
mxyng committed Dec 1, 2023
2 parents 6681d37 + bb80a59 commit cedae0d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions server/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cedae0d

Please sign in to comment.