Skip to content

Commit

Permalink
don't fail fatally when turns are improper
Browse files Browse the repository at this point in the history
  • Loading branch information
winglian committed Sep 26, 2023
1 parent 4483f1b commit 654bbcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/axolotl/prompters.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ def build_prompt(self, source) -> Generator[str, None, None]:
conv.messages = []
for j, sentence in enumerate(source):
role = roles[sentence["from"]]
assert role == conv.roles[j % 2], SHAREGPT_ASSERTION_FAILED_ROLE
if role != conv.roles[j % 2]:
LOG.warning(f"{SHAREGPT_ASSERTION_FAILED_ROLE}: {sentence}")
conv.append_message(role, sentence["value"])

for part in conv.get_turns():
Expand Down

0 comments on commit 654bbcc

Please sign in to comment.