[PR #5243] [MERGED] Fix use_mmap for modefiles #37594

Closed
opened 2026-04-22 22:16:30 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5243
Author: @dhiltgen
Created: 6/23/2024
Status: Merged
Merged: 7/3/2024
Merged by: @dhiltgen

Base: mainHead: modelfile_use_mmap


📝 Commits (1)

  • 97c9e11 Switch use_mmap to a pointer type

📊 Changes

3 files changed (+63 additions, -93 deletions)

View changed files

📝 api/types.go (+35 -70)
📝 api/types_test.go (+22 -18)
📝 llm/server.go (+6 -5)

📄 Description

PR #5205 was incomplete and missed handling numeric json values. This switches to a pointer type to represent undefined as nil.

Fixes #5198

% cat use_mmap.modelfile
FROM library/llama2
PARAMETER use_mmap false
% ollama create test -f ./use_mmap.modelfile
transferring model data
using existing layer sha256:8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246
...
writing manifest
success
% ollama run test
>>> Send a message (/? for help)
% grep "starting llama server" server.log
time=2024-06-23T12:59:32.057-07:00 level=INFO source=server.go:363 msg="starting llama server" cmd="/tmp/ollama4152649118/runners/cpu_avx2/ollama_llama_server --model /home/daniel/.ollama/models/blobs/sha256-8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 --ctx-size 2048 --batch-size 512 --embedding --log-disable --no-mmap --parallel 1 --port 34091"

🔄 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/5243 **Author:** [@dhiltgen](https://github.com/dhiltgen) **Created:** 6/23/2024 **Status:** ✅ Merged **Merged:** 7/3/2024 **Merged by:** [@dhiltgen](https://github.com/dhiltgen) **Base:** `main` ← **Head:** `modelfile_use_mmap` --- ### 📝 Commits (1) - [`97c9e11`](https://github.com/ollama/ollama/commit/97c9e11768292c8f2732e2f4c9cde72a604c936b) Switch use_mmap to a pointer type ### 📊 Changes **3 files changed** (+63 additions, -93 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+35 -70) 📝 `api/types_test.go` (+22 -18) 📝 `llm/server.go` (+6 -5) </details> ### 📄 Description PR #5205 was incomplete and missed handling numeric json values. This switches to a pointer type to represent undefined as nil. Fixes #5198 ``` % cat use_mmap.modelfile FROM library/llama2 PARAMETER use_mmap false % ollama create test -f ./use_mmap.modelfile transferring model data using existing layer sha256:8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 ... writing manifest success % ollama run test >>> Send a message (/? for help) % grep "starting llama server" server.log time=2024-06-23T12:59:32.057-07:00 level=INFO source=server.go:363 msg="starting llama server" cmd="/tmp/ollama4152649118/runners/cpu_avx2/ollama_llama_server --model /home/daniel/.ollama/models/blobs/sha256-8934d96d3f08982e95922b2b7a2c626a1fe873d7c3b06e8e56d7bc0a1fef9246 --ctx-size 2048 --batch-size 512 --embedding --log-disable --no-mmap --parallel 1 --port 34091" ``` --- <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 22:16: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#37594