Skip to content

Commit

Permalink
bugfix: chat turns instead of repeating the conversation in preproces…
Browse files Browse the repository at this point in the history
…s_data_with_chat_template.py (#1258)

* bugfix: chat turns instead of repeating the conversation

* pre-commit
  • Loading branch information
dmahan93 authored Aug 15, 2024
1 parent c1ea2a1 commit 0ef2c07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/datasets/preprocess_data_with_chat_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def build_chat(
)
chat_tokens = tokenizer.apply_chat_template(
chat[: i + 1], add_generation_prompt=add_gen
)
)[len(tokens) :]
# remove previous stuff...
tokens.extend(chat_tokens)
if only_last_turn and (i != len(chat) - 1):
Expand Down

0 comments on commit 0ef2c07

Please sign in to comment.