[PR #14812] fix: use consistent binary units (TiB/GiB/MiB/KiB) in HumanBytes #61548

Open
opened 2026-04-29 16:37:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14812
Author: @LincolnBurrows2017
Created: 3/13/2026
Status: 🔄 Open

Base: mainHead: fix/humanbytes-binary-units


📝 Commits (2)

  • c48be94 fix: correct typo ViewSeperator -> ViewSeparator in deepseekocr model
  • 50b191e fix: use consistent binary units (TiB/GiB/MiB/KiB) in HumanBytes

📊 Changes

3 files changed (+42 additions, -35 deletions)

View changed files

📝 format/bytes.go (+15 -12)
📝 format/bytes_test.go (+25 -20)
📝 model/models/deepseekocr/model.go (+2 -3)

📄 Description

Description

This PR fixes issue #14790 by making HumanBytes use consistent binary units (TiB/GiB/MiB/KiB) instead of decimal units (TB/GB/MB/KB).

Changes:

  • Add TebiByte constant (1024^4) to the constants
  • Update HumanBytes function to use binary units
  • Add TebiByte support to HumanBytes2 function
  • Update tests to reflect new binary unit output

Why this matters:

Using binary units (KiB/MiB/GiB/TiB) is the correct convention for measuring computer memory and is consistent with how HumanBytes2 already works.

Fixes #14790


🔄 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/14812 **Author:** [@LincolnBurrows2017](https://github.com/LincolnBurrows2017) **Created:** 3/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/humanbytes-binary-units` --- ### 📝 Commits (2) - [`c48be94`](https://github.com/ollama/ollama/commit/c48be94ac71ffe697cb92e7ca4b8eecd6d93826b) fix: correct typo ViewSeperator -> ViewSeparator in deepseekocr model - [`50b191e`](https://github.com/ollama/ollama/commit/50b191edede819049e59fa6ce791054942360ab8) fix: use consistent binary units (TiB/GiB/MiB/KiB) in HumanBytes ### 📊 Changes **3 files changed** (+42 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `format/bytes.go` (+15 -12) 📝 `format/bytes_test.go` (+25 -20) 📝 `model/models/deepseekocr/model.go` (+2 -3) </details> ### 📄 Description ## Description This PR fixes issue #14790 by making `HumanBytes` use consistent binary units (TiB/GiB/MiB/KiB) instead of decimal units (TB/GB/MB/KB). ### Changes: - Add `TebiByte` constant (1024^4) to the constants - Update `HumanBytes` function to use binary units - Add TebiByte support to `HumanBytes2` function - Update tests to reflect new binary unit output ### Why this matters: Using binary units (KiB/MiB/GiB/TiB) is the correct convention for measuring computer memory and is consistent with how `HumanBytes2` already works. Fixes #14790 --- <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-29 16:37:30 -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#61548