refactor: Improve model registration and settings handling

This commit is contained in:
Paul Gauthier 2024-11-23 12:57:24 -08:00 committed by Paul Gauthier (aider)
parent 8f83204f0f
commit baa13351a6

View file

@ -935,10 +935,11 @@ class Model(ModelSettings):
and ("2.5" in model or "2-5" in model)
and "32b" in model
):
"openrouter/qwen/qwen-2.5-coder-32b-instruct",
self.edit_format = "diff"
self.editor_edit_format = "editor-diff"
self.use_repo_map = True
# if "ollama" in model:
# self.extra_params = dict(num_ctx = 64*1024)
return # <--
# use the defaults
@ -1101,6 +1102,9 @@ def register_models(model_settings_fnames):
if not os.path.exists(model_settings_fname):
continue
if not Path(model_settings_fname).read_text().strip():
continue
try:
with open(model_settings_fname, "r") as model_settings_file:
model_settings_list = yaml.safe_load(model_settings_file)