mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-14 09:47:02 +00:00
Ensure sparse files on windows during download
The file.Truncate call on windows will write the whole file unless you set the sparse flag, leading to heavy I/O at the beginning of download. This should improve our I/O behavior on windows and put less stress on the users disk.
This commit is contained in:
@@ -216,6 +216,9 @@ func (b *blobDownload) run(ctx context.Context, requestURL *url.URL, opts *regis
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
if err := setSparse(file); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_ = file.Truncate(b.Total)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user