From 8c8fb2f9f0ee2a9fd57243bb0fb46cc5cb06ed26 Mon Sep 17 00:00:00 2001 From: jmorganca Date: Sat, 20 Dec 2025 18:10:24 -0800 Subject: [PATCH] tweak --- server/download.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/download.go b/server/download.go index 964115a81..e7523a890 100644 --- a/server/download.go +++ b/server/download.go @@ -140,7 +140,7 @@ const numDownloadParts = 16 var ( // downloadPartSize is the size of each download part. // Default: 16MB. Override with OLLAMA_DOWNLOAD_PART_SIZE (in MB). - downloadPartSize = int64(getEnvInt("OLLAMA_DOWNLOAD_PART_SIZE", 16)) * format.MegaByte + downloadPartSize = int64(getEnvInt("OLLAMA_DOWNLOAD_PART_SIZE", 32)) * format.MegaByte // downloadConcurrency limits concurrent part downloads. // Higher = faster on fast connections. Memory stays ~64KB regardless. @@ -626,9 +626,9 @@ func (b *blobDownload) downloadChunkToDisk(ctx context.Context, requestURL *url. return errPartStalled } - // Check for slow speed after 5+ seconds + // Check for slow speed after 5+ seconds (only for multi-part downloads) elapsed := time.Since(startTime).Seconds() - if elapsed >= 5 && currentBytes > 0 { + if elapsed >= 5 && currentBytes > 0 && len(b.Parts) > 1 { currentSpeed := float64(currentBytes) / elapsed median := tracker.Median()