Skip to content

Commit

Permalink
create the blobs directory correctly (ollama#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdevine authored Sep 11, 2023
1 parent 7d749cc commit 45ac07c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/modelpath.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,12 @@ func GetBlobsPath(digest string) (string, error) {
}

path := filepath.Join(home, ".ollama", "models", "blobs", digest)
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
dirPath := filepath.Dir(path)
if digest == "" {
dirPath = path
}

if err := os.MkdirAll(dirPath, 0o755); err != nil {
return "", err
}

Expand Down

0 comments on commit 45ac07c

Please sign in to comment.