mirror of
https://github.com/tcsenpai/ollama.git
synced 2025-06-12 22:17:09 +00:00
get the proper path for blobs to delete (#168)
This commit is contained in:
parent
9f6e97865c
commit
b8421dce3d
@ -548,9 +548,13 @@ func DeleteModel(name string, fn func(api.ProgressResponse)) error {
|
|||||||
// only delete the files which are still in the deleteMap
|
// only delete the files which are still in the deleteMap
|
||||||
for k, v := range deleteMap {
|
for k, v := range deleteMap {
|
||||||
if v {
|
if v {
|
||||||
err := os.Remove(k)
|
fp, err := GetBlobsPath(k)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("couldn't remove file '%s': %v", k, err)
|
log.Printf("couldn't get file path for '%s': %v", k, err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if err := os.Remove(fp); err != nil {
|
||||||
|
log.Printf("couldn't remove file '%s': %v", fp, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user