wip
This commit is contained in:
@@ -15,7 +15,6 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
@@ -109,8 +108,8 @@ var (
|
|||||||
|
|
||||||
// downloadConcurrency limits concurrent part downloads.
|
// downloadConcurrency limits concurrent part downloads.
|
||||||
// Higher = faster on fast connections. Memory stays ~64KB regardless.
|
// Higher = faster on fast connections. Memory stays ~64KB regardless.
|
||||||
// Default: 2 * GOMAXPROCS (scales with CPU cores). Override with OLLAMA_DOWNLOAD_CONCURRENCY.
|
// Default: 64. Override with OLLAMA_DOWNLOAD_CONCURRENCY.
|
||||||
downloadConcurrency = getEnvInt("OLLAMA_DOWNLOAD_CONCURRENCY", 2*runtime.GOMAXPROCS(0))
|
downloadConcurrency = getEnvInt("OLLAMA_DOWNLOAD_CONCURRENCY", 64)
|
||||||
)
|
)
|
||||||
|
|
||||||
func getEnvInt(key string, defaultVal int) int {
|
func getEnvInt(key string, defaultVal int) int {
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
//go:build !windows
|
|
||||||
|
|
||||||
package server
|
|
||||||
|
|
||||||
import "os"
|
|
||||||
|
|
||||||
func setSparse(*os.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,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user