This commit is contained in:
jmorganca 2025-12-20 18:01:07 -08:00
parent 51cb1155ba
commit 55b1ee2557
3 changed files with 2 additions and 28 deletions

View File

@ -15,7 +15,6 @@ import (
"net/url"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"sync"
@ -109,8 +108,8 @@ var (
// downloadConcurrency limits concurrent part downloads.
// Higher = faster on fast connections. Memory stays ~64KB regardless.
// Default: 2 * GOMAXPROCS (scales with CPU cores). Override with OLLAMA_DOWNLOAD_CONCURRENCY.
downloadConcurrency = getEnvInt("OLLAMA_DOWNLOAD_CONCURRENCY", 2*runtime.GOMAXPROCS(0))
// Default: 64. Override with OLLAMA_DOWNLOAD_CONCURRENCY.
downloadConcurrency = getEnvInt("OLLAMA_DOWNLOAD_CONCURRENCY", 64)
)
func getEnvInt(key string, defaultVal int) int {

View File

@ -1,8 +0,0 @@
//go:build !windows
package server
import "os"
func setSparse(*os.File) {
}

View File

@ -1,17 +0,0 @@
package server
import (
"os"
"golang.org/x/sys/windows"
)
func setSparse(file *os.File) {
// exFat (and other FS types) don't support sparse files, so ignore errors
windows.DeviceIoControl( //nolint:errcheck
windows.Handle(file.Fd()), windows.FSCTL_SET_SPARSE,
nil, 0,
nil, 0,
nil, nil,
)
}