[PR #3607] [MERGED] Add llama2 / torch models for ollama create #16487

Closed
opened 2026-04-16 05:32:12 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/3607
Author: @pdevine
Created: 4/11/2024
Status: Merged
Merged: 4/15/2024
Merged by: @pdevine

Base: mainHead: pdevine/torch


📝 Commits (7)

📊 Changes

11 files changed (+860 additions, -291 deletions)

View changed files

📝 cmd/cmd.go (+29 -5)
📝 convert/convert.go (+22 -272)
📝 convert/gemma.go (+4 -3)
convert/llama.go (+176 -0)
📝 convert/mistral.go (+2 -2)
convert/safetensors.go (+304 -0)
convert/torch.go (+286 -0)
📝 go.mod (+5 -2)
📝 go.sum (+4 -2)
📝 llm/gguf.go (+18 -0)
📝 server/images.go (+10 -5)

📄 Description

This change adds support for llama2 converting from pytorch files. It splits adds the concept of a ModelFormat (to split up torch vs safetensors) and a ModelArch (for models like llama2, mistral, and gemma).

For the torch files this change only looks for .bin files, but should include .pth and other torch filename extensions.


🔄 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/3607 **Author:** [@pdevine](https://github.com/pdevine) **Created:** 4/11/2024 **Status:** ✅ Merged **Merged:** 4/15/2024 **Merged by:** [@pdevine](https://github.com/pdevine) **Base:** `main` ← **Head:** `pdevine/torch` --- ### 📝 Commits (7) - [`210d6f0`](https://github.com/ollama/ollama/commit/210d6f0858ed83267343dc7eed20b6fc90225d3e) add new torch arch - [`1a49b10`](https://github.com/ollama/ollama/commit/1a49b10f5d2b07fe4c3c9a5d46735f3acc703c7e) fixup - [`a309220`](https://github.com/ollama/ollama/commit/a309220c6971d063ab6a506710c5403f389b1a85) add new torch arch - [`66816e1`](https://github.com/ollama/ollama/commit/66816e15c2462858f3aee89849f3af5f1e758ebc) more torch changes - [`ecec68a`](https://github.com/ollama/ollama/commit/ecec68af7269c4e6480beb86614e0e5f8e18767a) add llama2 - [`5e47572`](https://github.com/ollama/ollama/commit/5e4757226b404460a808b10a11405983c5c328b6) gomod fixup - [`68a5bb1`](https://github.com/ollama/ollama/commit/68a5bb1538f516f4f22c0e6be2506cd4f9bc3aef) feed the linter ### 📊 Changes **11 files changed** (+860 additions, -291 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+29 -5) 📝 `convert/convert.go` (+22 -272) 📝 `convert/gemma.go` (+4 -3) ➕ `convert/llama.go` (+176 -0) 📝 `convert/mistral.go` (+2 -2) ➕ `convert/safetensors.go` (+304 -0) ➕ `convert/torch.go` (+286 -0) 📝 `go.mod` (+5 -2) 📝 `go.sum` (+4 -2) 📝 `llm/gguf.go` (+18 -0) 📝 `server/images.go` (+10 -5) </details> ### 📄 Description This change adds support for llama2 converting from pytorch files. It splits adds the concept of a `ModelFormat` (to split up torch vs safetensors) and a `ModelArch` (for models like llama2, mistral, and gemma). For the torch files this change only looks for `.bin` files, but should include `.pth` and other torch filename extensions. --- <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-16 05:32:12 -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#16487