[PR #1549] [MERGED] allow for starting llava queries with filepath #15886

Closed
opened 2026-04-16 05:11:06 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/1549
Author: @BruceMacD
Created: 12/15/2023
Status: Merged
Merged: 12/21/2023
Merged by: @BruceMacD

Base: mainHead: brucemacd/cli-start-llava-file


📝 Commits (5)

📊 Changes

1 file changed (+24 additions, -5 deletions)

View changed files

📝 cmd/cmd.go (+24 -5)

📄 Description

  • shared cmd file pattern regex
  • do not error when multimodal has starting file

There was a bug that a multimodal query starting with an unescaped file path resulted in an "Unknown command" error.

This change allows for multimodal models to have queries starting with the filepath.

$ ollama run llava
>>> /test
Unknown command '/test'. Type /? for help
>>> /Users/bruce/Downloads/Ollama_christmas_background.png what is this
Added image '/Users/bruce/Downloads/Ollama_christmas_background.png'
 This is a cartoon of cats, and it appears to be an illustration or drawing of the animals. The scene depicts them gathered around a Christmas tree. In total, there are nine cats in various positions, with some standing close together while others are more spread out. One cat can be seen sitting underneath the 
tree, perhaps enjoying the holiday festivities. The overall atmosphere seems to be joyful and playful as these cats interact and pose around their Christmas tree setting.

$ ollama run llama2
>>> /Users/bruce/Downloads/Ollama_christmas_background.png what is this
Unknown command '/Users/bruce/Downloads/Ollama_christmas_background.png'. Type /? for help

resolves #1511


🔄 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/1549 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 12/15/2023 **Status:** ✅ Merged **Merged:** 12/21/2023 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/cli-start-llava-file` --- ### 📝 Commits (5) - [`edaf826`](https://github.com/ollama/ollama/commit/edaf8269603f5af6d5bdef7e46ff8f81d06dddb5) allow for starting llava queries with filepath - [`7a413c2`](https://github.com/ollama/ollama/commit/7a413c2eda3061b7671be8dd96aa712ec7565a58) reuse extractFileNames - [`ba25a48`](https://github.com/ollama/ollama/commit/ba25a480dd47b85d9cc215946075ec37180a0bcb) Update cmd/cmd.go - [`0a77cd1`](https://github.com/ollama/ollama/commit/0a77cd18aeac5bee93ab50757b73736d9c6dcb67) allow for files with spaces in the name - [`88da5a1`](https://github.com/ollama/ollama/commit/88da5a158482d147bf80a075c53defd3b3733cf9) Merge branch 'brucemacd/cli-start-llava-file' of https://github.com/jmorganca/ollama into brucemacd/cli-start-llava-file ### 📊 Changes **1 file changed** (+24 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+24 -5) </details> ### 📄 Description - shared cmd file pattern regex - do not error when multimodal has starting file There was a bug that a multimodal query starting with an unescaped file path resulted in an "Unknown command" error. This change allows for multimodal models to have queries starting with the filepath. ``` $ ollama run llava >>> /test Unknown command '/test'. Type /? for help >>> /Users/bruce/Downloads/Ollama_christmas_background.png what is this Added image '/Users/bruce/Downloads/Ollama_christmas_background.png' This is a cartoon of cats, and it appears to be an illustration or drawing of the animals. The scene depicts them gathered around a Christmas tree. In total, there are nine cats in various positions, with some standing close together while others are more spread out. One cat can be seen sitting underneath the tree, perhaps enjoying the holiday festivities. The overall atmosphere seems to be joyful and playful as these cats interact and pose around their Christmas tree setting. $ ollama run llama2 >>> /Users/bruce/Downloads/Ollama_christmas_background.png what is this Unknown command '/Users/bruce/Downloads/Ollama_christmas_background.png'. Type /? for help ``` resolves #1511 --- <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:11:06 -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#15886