mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 02:34:59 +00:00
feat: Update kwargs to include num_ctx for ollama if not set
This commit is contained in:
parent
f21ef30482
commit
e313a2ea45
1 changed files with 2 additions and 3 deletions
|
@ -560,9 +560,8 @@ class Model(ModelSettings):
|
|||
kwargs["tool_choice"] = {"type": "function", "function": {"name": function["name"]}}
|
||||
if self.extra_params:
|
||||
kwargs.update(self.extra_params)
|
||||
|
||||
# if is_ollama and kwargs[num_ctx] isn't set: num_ctx = token_count(messages) * 1.5 ai!
|
||||
|
||||
if self.is_ollama() and "num_ctx" not in kwargs:
|
||||
kwargs["num_ctx"] = int(self.token_count(messages) * 1.5)
|
||||
key = json.dumps(kwargs, sort_keys=True).encode()
|
||||
# dump(kwargs)
|
||||
hash_object = hashlib.sha1(key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue