[PR #110] [MERGED] fix pull 0 bytes on completed layer #15266

Closed
opened 2026-04-16 04:54:20 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/110
Author: @mxyng
Created: 7/19/2023
Status: Merged
Merged: 7/19/2023
Merged by: @mxyng

Base: mainHead: fix-pull-0-bytes


📝 Commits (1)

  • 68df36a fix pull 0 bytes on completed layer

📊 Changes

5 files changed (+82 additions, -65 deletions)

View changed files

📝 api/client.go (+4 -4)
📝 api/types.go (+1 -10)
📝 cmd/cmd.go (+10 -12)
📝 server/images.go (+61 -23)
📝 server/routes.go (+6 -16)

📄 Description

This PR fixes the bug where when the progress bar displays 0B for a layer when the layer already exists:

$ ollama pull llama2
pulling manifest
pulling 8daa9615cce30c25...   0% |                                                                                                                                                  | ( 0 B/3.5 GB) [0s:0s]
pulling c929c04af928be41...   0% |                                                                                                                                                  | ( 0 B/3.5 GB) [0s:0s]
pulling cf39c1a5c36937e4... 100% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (3.5/3.5 GB, 53 TB/s)
writing manifest
success
$ ollama pull llama2
pulling manifest
pulling 8daa9615cce30c25... 100% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (3.5/3.5 GB, 16 TB/s)
pulling c929c04af928be41... 100% |███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (547/547 B, 12 MB/s)
pulling cf39c1a5c36937e4... 100% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (225/225 B, 5.0 MB/s)
writing manifest
success

Now each layer also correctly reports the layer's size rather than the total bundle size.

Refactor Pull/PushProgress into ProgressResponse since they share the exact same attributes and remove Percent since it's not being used and the caller can easily compute it for themselves


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/110 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 7/19/2023 **Status:** ✅ Merged **Merged:** 7/19/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `fix-pull-0-bytes` --- ### 📝 Commits (1) - [`68df36a`](https://github.com/ollama/ollama/commit/68df36ae509e5e2ad5909b810f5a263b0a54cd46) fix pull 0 bytes on completed layer ### 📊 Changes **5 files changed** (+82 additions, -65 deletions) <details> <summary>View changed files</summary> 📝 `api/client.go` (+4 -4) 📝 `api/types.go` (+1 -10) 📝 `cmd/cmd.go` (+10 -12) 📝 `server/images.go` (+61 -23) 📝 `server/routes.go` (+6 -16) </details> ### 📄 Description This PR fixes the bug where when the progress bar displays 0B for a layer when the layer already exists: ``` $ ollama pull llama2 pulling manifest pulling 8daa9615cce30c25... 0% | | ( 0 B/3.5 GB) [0s:0s] pulling c929c04af928be41... 0% | | ( 0 B/3.5 GB) [0s:0s] pulling cf39c1a5c36937e4... 100% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (3.5/3.5 GB, 53 TB/s) writing manifest success ``` ``` $ ollama pull llama2 pulling manifest pulling 8daa9615cce30c25... 100% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (3.5/3.5 GB, 16 TB/s) pulling c929c04af928be41... 100% |███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (547/547 B, 12 MB/s) pulling cf39c1a5c36937e4... 100% |██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| (225/225 B, 5.0 MB/s) writing manifest success ``` Now each layer also correctly reports the layer's size rather than the total bundle size. Refactor `Pull/PushProgress` into `ProgressResponse` since they share the exact same attributes and remove `Percent` since it's not being used and the caller can easily compute it for themselves --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 04:54:20 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#15266