Prompts Being ignored #295

Closed
opened 2026-02-15 16:29:42 -05:00 by yindo · 4 comments
Owner

Originally created by @simonking-del on GitHub (Sep 10, 2025).

I have a Python script cycling through 1000's of files but picking one up at a time, loading the contents then calling to Ollama to analyse the content looking for specific data. If it finds the required data (a contractual period of weeks or months) it then outputs to a CSV.

Quite often it ignores the prompt and gives me a breakdown of the complete document (not what I asked for). I have ensured that there is no context carryover and each call is unique, my prompt even says

"I do NOT want a breakdown of the document ONLY respond with what I ask here: From the following Document text, .....(e.g., '4 weeks' or '3 months'). Respond ONLY with ........., or if no ..... is found, ONLY respond with 'Not found'. \n\nDocument text:\n{text_content}. Do not include any other text or details."

Originally created by @simonking-del on GitHub (Sep 10, 2025). I have a Python script cycling through 1000's of files but picking one up at a time, loading the contents then calling to Ollama to analyse the content looking for specific data. If it finds the required data (a contractual period of weeks or months) it then outputs to a CSV. Quite often it ignores the prompt and gives me a breakdown of the complete document (not what I asked for). I have ensured that there is no context carryover and each call is unique, my prompt even says "I do NOT want a breakdown of the document ONLY respond with what I ask here: From the following Document text, .....(e.g., '4 weeks' or '3 months'). Respond ONLY with ........., or if no ..... is found, ONLY respond with 'Not found'. \n\nDocument text:\n{text_content}. Do not include any other text or details."
yindo closed this issue 2026-02-15 16:29:42 -05:00
Author
Owner

@rick-github commented on GitHub (Sep 12, 2025):

Sounds like you are exceeding the context window and ollama is truncating the start of the prompt. Increase context size.

@rick-github commented on GitHub (Sep 12, 2025): Sounds like you are exceeding the context window and ollama is truncating the start of the prompt. Increase [context size](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size).
Author
Owner

@simonking-del commented on GitHub (Sep 15, 2025):

Ive tried it with context set a zero (as each time it runs through its told exactly what to do) and extended context up to 8096 - every time it ignores what I'm asking for and gives a summary of the whole document. Ive changed the working of the prompt to ask in several ways - for some documents it responds correctly and others (in the same run) it ignores and gives a summary

@simonking-del commented on GitHub (Sep 15, 2025): Ive tried it with context set a zero (as each time it runs through its told exactly what to do) and extended context up to 8096 - every time it ignores what I'm asking for and gives a summary of the whole document. Ive changed the working of the prompt to ask in several ways - for some documents it responds correctly and others (in the same run) it ignores and gives a summary
Author
Owner

@rick-github commented on GitHub (Sep 15, 2025):

Server logs may aid in debugging.

@rick-github commented on GitHub (Sep 15, 2025): [Server logs](https://github.com/ollama/ollama/blob/main/docs/troubleshooting.md#how-to-troubleshoot-issues) may aid in debugging.
Author
Owner

@ParthSareen commented on GitHub (Sep 18, 2025):

A file can range from hundreds to thousands of tokens. in that case you'd be exceeding your context limit pretty quick. We're planning to improve this to work a bit better in these situations but I'd recommend capping your input for now.

@ParthSareen commented on GitHub (Sep 18, 2025): A file can range from hundreds to thousands of tokens. in that case you'd be exceeding your context limit pretty quick. We're planning to improve this to work a bit better in these situations but I'd recommend capping your input for now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#295