From 1c288f7749747c6b1908ae16c977f80e5597d2ca Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 14 Aug 2023 12:45:29 -0700 Subject: fix: :bug: MAX_TOKENS_FOR_MODEL bug fix, more testing --- continuedev/src/continuedev/libs/llm/openai.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'continuedev/src') diff --git a/continuedev/src/continuedev/libs/llm/openai.py b/continuedev/src/continuedev/libs/llm/openai.py index 5f1ef7fa..7eb516a3 100644 --- a/continuedev/src/continuedev/libs/llm/openai.py +++ b/continuedev/src/continuedev/libs/llm/openai.py @@ -22,11 +22,12 @@ CHAT_MODELS = { MAX_TOKENS_FOR_MODEL = { "gpt-3.5-turbo": 4096, "gpt-3.5-turbo-0613": 4096, - "gpt-3.5-turbo-16k": 16384, + "gpt-3.5-turbo-16k": 16_384, "gpt-4": 8192, - "gpt-35-turbo-16k": 16384, + "gpt-35-turbo-16k": 16_384, "gpt-35-turbo-0613": 4096, "gpt-35-turbo": 4096, + "gpt-4-32k": 32_768 } @@ -67,7 +68,7 @@ class OpenAI(LLM): @property def context_length(self): - return MAX_TOKENS_FOR_MODEL[self.model] + return MAX_TOKENS_FOR_MODEL.get(self.model, 4096) @property def default_args(self): -- cgit v1.2.3-70-g09d2