[PR #3619] [MERGED] types/model: add path helpers #37095

Closed
opened 2026-04-22 21:47:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/3619
Author: @bmizerany
Created: 4/12/2024
Status: Merged
Merged: 4/13/2024
Merged by: @bmizerany

Base: mainHead: bmizerany/modelpaths


📝 Commits (2)

  • 1c69380 types/model: add path helpers
  • 72b69cd types/model: replace Parts with specific methods

📊 Changes

2 files changed (+308 additions, -42 deletions)

View changed files

📝 types/model/name.go (+110 -30)
📝 types/model/name_test.go (+198 -12)

📄 Description

This commit adds path helpers for working with Names in URL and file
paths. The new helpers are ParseNameFromPath, ParseNameFromFilePath,
Name.Path, and Name.FilePath.

This commit also adds Name.DisplayLongest, and Name.DisplayLong.

Also, update a place where strings.StripPrefix is more consistent
with the surrounding code.


🔄 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/3619 **Author:** [@bmizerany](https://github.com/bmizerany) **Created:** 4/12/2024 **Status:** ✅ Merged **Merged:** 4/13/2024 **Merged by:** [@bmizerany](https://github.com/bmizerany) **Base:** `main` ← **Head:** `bmizerany/modelpaths` --- ### 📝 Commits (2) - [`1c69380`](https://github.com/ollama/ollama/commit/1c6938011f7b8774f4616b1cb05ddbee37a1d191) types/model: add path helpers - [`72b69cd`](https://github.com/ollama/ollama/commit/72b69cd8dd405d61215cdc1c833c68fed1c4f069) types/model: replace Parts with specific methods ### 📊 Changes **2 files changed** (+308 additions, -42 deletions) <details> <summary>View changed files</summary> 📝 `types/model/name.go` (+110 -30) 📝 `types/model/name_test.go` (+198 -12) </details> ### 📄 Description This commit adds path helpers for working with Names in URL and file paths. The new helpers are ParseNameFromPath, ParseNameFromFilePath, Name.Path, and Name.FilePath. This commit also adds Name.DisplayLongest, and Name.DisplayLong. Also, update a place where strings.StripPrefix is more consistent with the surrounding code. --- <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 21:47:33 -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#37095