Skip to content

Commit

Permalink
Per Tanmay, implemented 16K context window for Code-Llama
Browse files Browse the repository at this point in the history
  • Loading branch information
KillianLucas committed Sep 4, 2023
1 parent 4f135c8 commit 1e6e5d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions interpreter/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1e6e5d8

Please sign in to comment.