mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
fix: handle missing extra_params attribute in Ollama model
This commit is contained in:
parent
02e8158918
commit
8ca81d0991
1 changed files with 2 additions and 1 deletions
|
@ -1247,7 +1247,8 @@ class Coder:
|
||||||
|
|
||||||
# Special warning for Ollama models about context window size
|
# Special warning for Ollama models about context window size
|
||||||
if self.main_model.name.startswith(("ollama/", "ollama_chat/")):
|
if self.main_model.name.startswith(("ollama/", "ollama_chat/")):
|
||||||
num_ctx = self.main_model.extra_params.get("num_ctx")
|
extra_params = getattr(self.main_model, "extra_params", None) or {}
|
||||||
|
num_ctx = extra_params.get("num_ctx")
|
||||||
if num_ctx:
|
if num_ctx:
|
||||||
self.io.tool_error(
|
self.io.tool_error(
|
||||||
f"\nNote: Your Ollama model is configured with num_ctx={num_ctx}. See"
|
f"\nNote: Your Ollama model is configured with num_ctx={num_ctx}. See"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue