Skip to content

Commit 2eaeb14

Browse files
committed
Dramatic CodeLlama improvements, Azure support, rate limit fix
1 parent eb4ed76 commit 2eaeb14

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

interpreter/interpreter.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,14 @@ def messages_to_prompt(messages):
412412
# Extracting the system prompt and initializing the formatted string with it.
413413
system_prompt = messages[0]['content']
414414
formatted_messages = f"<s>[INST] <<SYS>>\n{system_prompt}\n<</SYS>>\n"
415+
416+
for message in messages:
417+
# Happens if it immediatly writes code
418+
if "role" not in message:
419+
message["role"] = "assistant"
415420

416421
# Loop starting from the first user message
417422
for index, item in enumerate(messages[1:]):
418-
# Happens if it immediatly writes code
419-
if "role" not in item:
420-
item["role"] == "assistant"
421423
role = item['role']
422424
content = item['content']
423425

0 commit comments

Comments
 (0)