[PR #146] [MERGED] windows: fix model pulling #10012

Closed
opened 2026-04-12 22:49:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: fix-windows-pull


📝 Commits (1)

  • 6cea206 windows: fix model pulling

📊 Changes

2 files changed (+9 additions, -0 deletions)

View changed files

📝 server/images.go (+4 -0)
📝 server/modelpath.go (+5 -0)

📄 Description

There are two issues preventing pull from working as expected in Windows.

  1. Windows dislikes os.Rename when the file is still open. One approach is to close the file before calling rename. The approach taken in this PR is to call os.Symlink instead
  2. Windows errors when file paths contain : so replace the : in the digest name with -, e.g. sha256:0123456789abcdef... with sha256-0123456789abcdef.... This is done only for the blob file path. Non-file path instances of this string are unchanged

🔄 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/146 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 7/20/2023 **Status:** ✅ Merged **Merged:** 7/20/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `fix-windows-pull` --- ### 📝 Commits (1) - [`6cea206`](https://github.com/ollama/ollama/commit/6cea2061ec97130140c06f8bacc769a2c984e48e) windows: fix model pulling ### 📊 Changes **2 files changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/images.go` (+4 -0) 📝 `server/modelpath.go` (+5 -0) </details> ### 📄 Description There are two issues preventing pull from working as expected in Windows. 1. Windows dislikes `os.Rename` when the file is still open. One approach is to close the file before calling rename. The approach taken in this PR is to call `os.Symlink` instead 2. Windows errors when file paths contain `:` so replace the `:` in the digest name with `-`, e.g. `sha256:0123456789abcdef...` with `sha256-0123456789abcdef...`. This is done _only_ for the blob file path. Non-file path instances of this string are unchanged --- <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-12 22:49:49 -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#10012