[PR #313] [MERGED] fix embeddings invalid values #72387

Closed
opened 2026-05-05 03:54:26 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/313
Author: @BruceMacD
Created: 8/9/2023
Status: Merged
Merged: 8/10/2023
Merged by: @BruceMacD

Base: mainHead: brucemacd/embeddings-refactor


📝 Commits (1)

  • 984c9c6 fix embeddings invalid values

📊 Changes

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

View changed files

📝 llama/llama.go (+7 -15)
📝 server/images.go (+2 -24)

📄 Description

Embeddings were occasionally returning invalid values which meant we needed to reload and retry. This fix removes the cache token count which was causing this issue, and improves results. This also matches the llama.cpp example more closely.

It also adds theunsafe.Slice parsing that Mike suggested in my previous PR, upon further tests this actually works (and it seems faster).


🔄 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/313 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 8/9/2023 **Status:** ✅ Merged **Merged:** 8/10/2023 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/embeddings-refactor` --- ### 📝 Commits (1) - [`984c9c6`](https://github.com/ollama/ollama/commit/984c9c628cc990183e45b27dddf2d38537264ad3) fix embeddings invalid values ### 📊 Changes **2 files changed** (+9 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `llama/llama.go` (+7 -15) 📝 `server/images.go` (+2 -24) </details> ### 📄 Description Embeddings were occasionally returning invalid values which meant we needed to reload and retry. This fix removes the cache token count which was causing this issue, and improves results. This also matches the llama.cpp example more closely. It also adds the`unsafe.Slice` parsing that Mike suggested in my previous PR, upon further tests this actually works (and it seems faster). --- <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-05-05 03:54:26 -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#72387