mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24:59 +00:00
refactor: Prevent overwriting existing num_ctx for Ollama models
This commit is contained in:
parent
6725c9e3cd
commit
028477f34d
1 changed files with 4 additions and 3 deletions
|
@ -257,9 +257,10 @@ class Model(ModelSettings):
|
|||
if not exact_match:
|
||||
self.apply_generic_model_settings(model)
|
||||
|
||||
if model.startswith("ollama/") or model.startswith("ollama_chat/"): # and num_ctx isn't already set ai!
|
||||
self.extra_params = dict(num_ctx=8 * 1024)
|
||||
dump(self.extra_params)
|
||||
if model.startswith("ollama/") or model.startswith("ollama_chat/"):
|
||||
if not (self.extra_params and "num_ctx" in self.extra_params):
|
||||
self.extra_params = dict(num_ctx=8 * 1024)
|
||||
dump(self.extra_params)
|
||||
|
||||
|
||||
# Apply override settings last if they exist
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue