[PR #12311] [MERGED] fix: model load for unsupported embedding models #13781

Closed
opened 2026-04-13 00:36:18 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/12311
Author: @mxyng
Created: 9/17/2025
Status: Merged
Merged: 9/18/2025
Merged by: @mxyng

Base: mainHead: mxyng/fix-model-load


📝 Commits (1)

  • cd10767 fix: model load for unsupported embedding models

📊 Changes

2 files changed (+67 additions, -52 deletions)

View changed files

📝 model/model.go (+19 -22)
📝 model/model_test.go (+48 -30)

📄 Description

with #12181, there's now support for embeddings in ollama engine. this is done by mutating the architecture and adding _embed when it detects an embedding model. however this introduced a bug where if an embedding model was run based on an existing ollama engine model without an embedding implementation, e.g. llama4, it will pass the initial arch support check but fail when actually loaded.

there's currently two entrypoints to creating a model. previously this second entrypoint was necessary because calling model.New would also load the model. since #11818, this is no longer th case so merge them to reduce complexity


🔄 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/12311 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 9/17/2025 **Status:** ✅ Merged **Merged:** 9/18/2025 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/fix-model-load` --- ### 📝 Commits (1) - [`cd10767`](https://github.com/ollama/ollama/commit/cd10767197d33897d6ec4b3411f6b6f5747a2bb3) fix: model load for unsupported embedding models ### 📊 Changes **2 files changed** (+67 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `model/model.go` (+19 -22) 📝 `model/model_test.go` (+48 -30) </details> ### 📄 Description with #12181, there's now support for embeddings in ollama engine. this is done by mutating the architecture and adding `_embed` when it detects an embedding model. however this introduced a bug where if an embedding model was run based on an existing ollama engine model _without_ an embedding implementation, e.g. llama4, it will pass the initial arch support check but fail when actually loaded. there's currently two entrypoints to creating a model. previously this second entrypoint was necessary because calling `model.New` would also load the model. since #11818, this is no longer th case so merge them to reduce complexity --- <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-13 00:36:18 -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#13781