[PR #13599] [MERGED] fix: return error when embedding contains NaN or Inf values #14286

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13599
Author: @majiayu000
Created: 1/2/2026
Status: Merged
Merged: 1/3/2026
Merged by: @jmorganca

Base: mainHead: fix-13572-ollama-embedding-model-bge-m3--0102-0958


📝 Commits (1)

  • 0aa8f86 server: return error when embedding contains NaN or Inf values

📊 Changes

2 files changed (+36 additions, -14 deletions)

View changed files

📝 server/routes.go (+13 -5)
📝 server/routes_test.go (+23 -9)

📄 Description

Fixes #13572

Changes

  • Add NaN/Inf validation in the normalize function
  • Return clear error message when embedding contains invalid values
  • Add test cases for NaN and Inf inputs

🔄 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/13599 **Author:** [@majiayu000](https://github.com/majiayu000) **Created:** 1/2/2026 **Status:** ✅ Merged **Merged:** 1/3/2026 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `fix-13572-ollama-embedding-model-bge-m3--0102-0958` --- ### 📝 Commits (1) - [`0aa8f86`](https://github.com/ollama/ollama/commit/0aa8f86cc335efe80647b8847b35da43568f1645) server: return error when embedding contains NaN or Inf values ### 📊 Changes **2 files changed** (+36 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+13 -5) 📝 `server/routes_test.go` (+23 -9) </details> ### 📄 Description Fixes #13572 ## Changes - Add NaN/Inf validation in the normalize function - Return clear error message when embedding contains invalid values - Add test cases for NaN and Inf inputs --- <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:50:05 -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#14286