From 1e6e5d87711ed976f06dd2e322f732c7232ac95f Mon Sep 17 00:00:00 2001 From: KillianLucas <63927363+KillianLucas@users.noreply.github.com> Date: Mon, 4 Sep 2023 21:32:55 +0000 Subject: [PATCH] Per Tanmay, implemented 16K context window for Code-Llama --- interpreter/interpreter.py | 9 +++------ poetry.lock | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/interpreter/interpreter.py b/interpreter/interpreter.py index 2f18710b97..576e1c106c 100644 --- a/interpreter/interpreter.py +++ b/interpreter/interpreter.py @@ -149,6 +149,8 @@ def chat(self, message=None, return_messages=False): # ^ verify_api_key may set self.local to True, so we run this as an 'if', not 'elif': if self.local: + self.model = "code-llama" + # Code-Llama if self.llama_instance == None: @@ -166,6 +168,7 @@ def chat(self, message=None, return_messages=False): # Switch to GPT-4 self.local = False + self.model = "gpt-4" self.verify_api_key() # Display welcome message @@ -287,12 +290,6 @@ def respond(self): info = self.get_info_for_system_message() system_message = self.system_message + "\n\n" + info - if self.local: - # Model determines how much we'll trim the messages list to get it under the context limit - # So for Code-Llama, we'll use "gpt-3.5-turbo" which (i think?) has the same context window as Code-Llama - self.model = "gpt-3.5-turbo" - # In the future lets make --model {model} just work / include llama - messages = tt.trim(self.messages, self.model, system_message=system_message) if self.debug_mode: diff --git a/poetry.lock b/poetry.lock index 8744067ceb..d897135b29 100644 --- a/poetry.lock +++ b/poetry.lock @@ -944,13 +944,13 @@ blobfile = ["blobfile (>=2)"] [[package]] name = "tokentrim" -version = "0.1.4" +version = "0.1.6" description = "Easily trim 'messages' arrays for use with GPTs." optional = false python-versions = ">=3.6,<4.0" files = [ - {file = "tokentrim-0.1.4-py3-none-any.whl", hash = "sha256:3a21f4ae1c87ea9cfc9b4b18b921bb66de74c87d45caf07486e5b2f6212ec2f6"}, - {file = "tokentrim-0.1.4.tar.gz", hash = "sha256:ed215e78c3afc2ef9b3905baeac2327d5c11efb125ee3b7f98be8668829a9c01"}, + {file = "tokentrim-0.1.6-py3-none-any.whl", hash = "sha256:fb15d98ec2bef9abb1d7cec75b91de510eb5615176fa4305022da2db755b9157"}, + {file = "tokentrim-0.1.6.tar.gz", hash = "sha256:86c66f1f728f50b05188475f30188b7a6f241c343bdced4d93c1a3d9f94b1639"}, ] [package.dependencies]