mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 08:44:59 +00:00
cleaned up Model init
This commit is contained in:
parent
bd91cb7fb7
commit
8fb4ab2be3
2 changed files with 6 additions and 10 deletions
|
@ -13,6 +13,11 @@ class Model:
|
|||
|
||||
self.max_context_tokens = tokens * 1024
|
||||
|
||||
if self.is_gpt4() or self.is_gpt35():
|
||||
return
|
||||
|
||||
raise ValueError(f"Unsupported model: {name}")
|
||||
|
||||
def is_gpt4(self):
|
||||
return self.name.startswith("gpt-4")
|
||||
|
||||
|
@ -26,12 +31,3 @@ class Model:
|
|||
GPT4 = Model("gpt-4", 8)
|
||||
GPT35 = Model("gpt-3.5-turbo")
|
||||
GPT35_16k = Model("gpt-3.5-turbo-16k")
|
||||
|
||||
|
||||
def get_model(name):
|
||||
model = Model(name)
|
||||
|
||||
if model.is_gpt4() or model.is_gpt35():
|
||||
return model
|
||||
|
||||
raise ValueError(f"Unsupported model: {name}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue