[GH-ISSUE #10640] 对话上传附件后会忽略提示词 #6998

Closed
opened 2026-04-12 18:53:23 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Jeremy-33456 on GitHub (May 10, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10640

What is the issue?

Image

Image

Image

我上传了文件让模型分析却总是不按照我的要求去分析,后来看了思考过程发现是模型根本不知道我的提示词在猜测我要怎么分析并给出结果。我用硅基流动的同款模型测试了一下发现完全正常,这似乎是ollama的问题,因为我测试了ollama上几个模型都是这样。

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @Jeremy-33456 on GitHub (May 10, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10640 ### What is the issue? ![Image](https://github.com/user-attachments/assets/5aace1c1-6c8f-4511-a024-d45749d1abb7) ![Image](https://github.com/user-attachments/assets/62f5fabf-fb34-4b1f-a392-31ede0d06660) ![Image](https://github.com/user-attachments/assets/834c61db-f336-4c2e-b898-82ee0b32bb5b) 我上传了文件让模型分析却总是不按照我的要求去分析,后来看了思考过程发现是模型根本不知道我的提示词在猜测我要怎么分析并给出结果。我用硅基流动的同款模型测试了一下发现完全正常,这似乎是ollama的问题,因为我测试了ollama上几个模型都是这样。 ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-12 18:53:23 -05:00
Author
Owner

@galoisgroupcn commented on GitHub (May 10, 2025):

@Jeremy-33456 here's our fix. Please try and give us feedback. https://github.com/ollama/ollama/pull/10641

<!-- gh-comment-id:2868335723 --> @galoisgroupcn commented on GitHub (May 10, 2025): @Jeremy-33456 here's our fix. Please try and give us feedback. https://github.com/ollama/ollama/pull/10641
Author
Owner

@rick-github commented on GitHub (May 10, 2025):

Have you set the context length?

<!-- gh-comment-id:2869154526 --> @rick-github commented on GitHub (May 10, 2025): Have you set the [context length](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size)?
Author
Owner

@Jeremy-33456 commented on GitHub (May 10, 2025):

Have you set the context length?

I tried to set the OLLAMA_CONTEXT_LENGTH parameter but the result is the same

<!-- gh-comment-id:2869219862 --> @Jeremy-33456 commented on GitHub (May 10, 2025): > Have you set the [context length](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size)? I tried to set the OLLAMA_CONTEXT_LENGTH parameter but the result is the same
Author
Owner

@Jeremy-33456 commented on GitHub (May 13, 2025):

我找到问题的原因了,确实是文件大小超过了上下文的限制导致的,OLLAMA_CONTEXT_LENGTH这个参数必须要重启电脑后才能生效,单纯重启软件没用的。
造成这种情况的原因是ollama是从尾部往前读取的,我看到结果中引用了文档尾部的内容所以觉得ollama应该把文档都读取完了,其实只读取了文档尾部的内容,文档前部和提示词都没读取到。

<!-- gh-comment-id:2875463746 --> @Jeremy-33456 commented on GitHub (May 13, 2025): 我找到问题的原因了,确实是文件大小超过了上下文的限制导致的,OLLAMA_CONTEXT_LENGTH这个参数必须要重启电脑后才能生效,单纯重启软件没用的。 造成这种情况的原因是ollama是从尾部往前读取的,我看到结果中引用了文档尾部的内容所以觉得ollama应该把文档都读取完了,其实只读取了文档尾部的内容,文档前部和提示词都没读取到。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#6998