Use the Models enum instead of .value

This commit is contained in:
Paul Gauthier 2023-06-05 17:06:34 -07:00
parent 130f73c864
commit fcd8a6df73
3 changed files with 16 additions and 15 deletions

View file

@ -16,7 +16,7 @@ class Commands:
def __init__(self, io, coder):
self.io = io
self.coder = coder
self.tokenizer = tiktoken.encoding_for_model(coder.main_model)
self.tokenizer = tiktoken.encoding_for_model(coder.main_model.value)
def is_command(self, inp):
if inp[0] == "/":
@ -133,7 +133,7 @@ class Commands:
print()
print(f"{total:6.3f} total")
limit = 8 if self.coder.main_model == Models.GPT4.value else 4
limit = 8 if self.coder.main_model == Models.GPT4 else 4
remaining = limit - total
print(f"{remaining:6.3f} remaining")
print(f"{limit:6.3f} max context window")
@ -181,7 +181,7 @@ class Commands:
"was reset and removed from git.\n"
)
if self.coder.main_model != Models.GPT35.value:
if self.coder.main_model != Models.GPT35:
return prompts.undo_command_reply
def cmd_diff(self, args):