[PR #1347] [MERGED] Fix adapter loading from SHA hash #36430

Closed
opened 2026-04-22 21:05:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1347
Author: @jshph
Created: 12/1/2023
Status: Merged
Merged: 12/1/2023
Merged by: @mxyng

Base: mainHead: adapter-hash


📝 Commits (1)

  • bb80a59 Fix adapter loading from SHA hash

📊 Changes

1 file changed (+9 additions, -0 deletions)

View changed files

📝 server/images.go (+9 -0)

📄 Description

When I tried to load an adapter from a local .bin file (by using ollama create), the command errored out with Error: open /@sha256:ac5d2a80bc8bb4e9be08302373191c842a7edd3fcefd346d93e84941313b1c5a: no such file or directory. I believe this is because the sha hash was misinterpreted as a filepath. I found where this is handled in images.go and saw that models resolve hashes correctly but adapters do not. I don't have context on the past implementations of adapters, but maybe at one point the adapters were not hashed/versioned?

I hope this addresses the issue! One small thought is that this block of code might be able to be placed before the switch to reduce duplicated logic for model. Not sure if that'd have an impact on the other cases.


🔄 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/1347 **Author:** [@jshph](https://github.com/jshph) **Created:** 12/1/2023 **Status:** ✅ Merged **Merged:** 12/1/2023 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `adapter-hash` --- ### 📝 Commits (1) - [`bb80a59`](https://github.com/ollama/ollama/commit/bb80a597dbb3dcdcb8465d7813aa4fe3905a4be2) Fix adapter loading from SHA hash ### 📊 Changes **1 file changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `server/images.go` (+9 -0) </details> ### 📄 Description When I tried to load an adapter from a local .bin file (by using `ollama create`), the command errored out with `Error: open /@sha256:ac5d2a80bc8bb4e9be08302373191c842a7edd3fcefd346d93e84941313b1c5a: no such file or directory`. I believe this is because the sha hash was misinterpreted as a filepath. I found where this is handled in `images.go` and saw that `model`s resolve hashes correctly but adapters do not. I don't have context on the past implementations of adapters, but maybe at one point the adapters were not hashed/versioned? I hope this addresses the issue! One small thought is that this block of code might be able to be placed before the switch to reduce duplicated logic for `model`. Not sure if that'd have an impact on the other cases. --- <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-22 21:05:24 -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#36430