I think method 1 has a drawback: when I set a large num_ctx in modelfile, it will occupy a lot of GPU memory even if the model is not in use. Perhaps method 2 is better? We could increase num_ctx during the request, controlling it based on the length of the messages. Alternatively, we could give users a prompt, saying something like "Your request exceeds the context length and has been truncated for processing."
Originally created by @anrgct on GitHub (Jul 31, 2024).
# Bug Report
## Description
I raised this issue in the Ollama repository. Please take a look at this issue, https://github.com/ollama/ollama/issues/6026#issuecomment-2254547480, where the author provided two solutions:
1. Specify num_ctx in the modelfile
2. Pass options during the request
I think method 1 has a drawback: when I set a large num_ctx in modelfile, it will occupy a lot of GPU memory even if the model is not in use. Perhaps method 2 is better? We could increase num_ctx during the request, controlling it based on the length of the messages. Alternatively, we could give users a prompt, saying something like "Your request exceeds the context length and has been truncated for processing."
The issue with changing num_ctx is that it requires a reload of the model each time it's changed. This can have an even more negative effect on perceived user experience than it would seek to solve.
@justinh-rahb commented on GitHub (Jul 31, 2024):
The issue with changing `num_ctx` is that it requires a reload of the model each time it's changed. This can have an even more negative effect on perceived user experience than it would seek to solve.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @anrgct on GitHub (Jul 31, 2024).
Bug Report
Description
I raised this issue in the Ollama repository. Please take a look at this issue, https://github.com/ollama/ollama/issues/6026#issuecomment-2254547480, where the author provided two solutions:
I think method 1 has a drawback: when I set a large num_ctx in modelfile, it will occupy a lot of GPU memory even if the model is not in use. Perhaps method 2 is better? We could increase num_ctx during the request, controlling it based on the length of the messages. Alternatively, we could give users a prompt, saying something like "Your request exceeds the context length and has been truncated for processing."
@justinh-rahb commented on GitHub (Jul 31, 2024):
The issue with changing
num_ctxis that it requires a reload of the model each time it's changed. This can have an even more negative effect on perceived user experience than it would seek to solve.