From 67ee800c55c84d2dd83e25d3417567fa034528d0 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 14 Jun 2023 17:09:53 -0700 Subject: [PATCH] refactor models to add gpt-4-32k-0613 --- aider/models.py | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/aider/models.py b/aider/models.py index 36d6c10c9..143073799 100644 --- a/aider/models.py +++ b/aider/models.py @@ -1,36 +1,23 @@ -class Model_GPT4_32k: - name = "gpt-4-32k" - max_context_tokens = 32 * 1024 +class Model: + def __init__(self, name, max_context_tokens): + self.name = name + self.max_context_tokens = max_context_tokens * 1024 -GPT4_32k = Model_GPT4_32k() +# 4 +GPT4_32k = Model("gpt-4-32k", 32) +GPT4_32k_0613 = Model("gpt-4-32k-0613", 32) +GPT4 = Model("gpt-4", 8) -class Model_GPT4: - name = "gpt-4" - max_context_tokens = 8 * 1024 +GPT4_models = [GPT4, GPT4_32k, GPT4_32k_0613] +# 3.5 -GPT4 = Model_GPT4() - - -class Model_GPT35: - name = "gpt-3.5-turbo" - max_context_tokens = 4 * 1024 - - -GPT35 = Model_GPT35() - - -class Model_GPT35_16k: - name = "gpt-3.5-turbo-16k" - max_context_tokens = 16 * 1024 - - -GPT35_16k = Model_GPT35_16k() +GPT35 = Model("gpt-3.5-turbo", 4) +GPT35_16k = Model("gpt-3.5-turbo-16k", 16) GPT35_models = [GPT35, GPT35_16k] -GPT4_models = [GPT4, GPT4_32k] def get_model(name):