mirror of
https://github.com/ollama/ollama-python.git
synced 2026-07-21 09:05:23 -04:00
Prompts Being ignored #295
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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."
@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.
@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
@rick-github commented on GitHub (Sep 15, 2025):
Server logs may aid in debugging.
@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.