We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb4ed76 commit 2eaeb14Copy full SHA for 2eaeb14
interpreter/interpreter.py
@@ -412,12 +412,14 @@ def messages_to_prompt(messages):
412
# Extracting the system prompt and initializing the formatted string with it.
413
system_prompt = messages[0]['content']
414
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"
420
421
# Loop starting from the first user message
422
for index, item in enumerate(messages[1:]):
- # Happens if it immediatly writes code
- if "role" not in item:
- item["role"] == "assistant"
423
role = item['role']
424
content = item['content']
425
0 commit comments