Skip to content

Commit

Permalink
revert: fixes of prepending system prompt manually
Browse files Browse the repository at this point in the history
Not needed now since with last fixes of at commands it works well always
  • Loading branch information
humbertoyusta committed Dec 20, 2024
1 parent 7088116 commit 2e893fd
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions python_binding_and_cmdline/refact/chat_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,14 @@ def join_messages_and_choices(
if len(deterministic_messages) > 0 and deterministic_messages[-1].role == "user":
while len(messages) > 0 and messages[-1].role == "user":
messages.pop()
messages.extend(deterministic_messages)
msg: Optional[Message]
for msg in deterministic_messages:
if msg.role == "system":
messages.insert(0, msg)
else:
messages.append(msg)
if verbose:
if verbose:
for msg in deterministic_messages:
print("deterministic",
termcolor.colored(str(msg.role), "yellow"),
str(msg.content),
termcolor.colored(str(msg.finish_reason), "red"))
termcolor.colored(str(msg.role), "yellow"),
str(msg.content),
termcolor.colored(str(msg.finish_reason), "red"))
output = [copy.deepcopy(messages) for _ in range(len(choices))]
for i, msg in enumerate(choices):
if msg is None:
Expand Down

0 comments on commit 2e893fd

Please sign in to comment.