Skip to content

Commit

Permalink
Update one line of code to accomodate for the self-distillation process.
Browse files Browse the repository at this point in the history
Modified src/llmtuner/data/template.py at line 92. Add `resp=messages[i + 1]["content"]` to allow for an additional argument.
  • Loading branch information
rickyang1114 committed Mar 1, 2024
1 parent 4e5fae2 commit 6ca8c1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/llmtuner/data/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _encode(
elements += self.format_separator.apply()

if message["role"] == Role.USER.value:
elements += self.format_user.apply(content=message["content"], idx=str(i // 2))
elements += self.format_user.apply(content=message["content"], idx=str(i // 2), resp=messages[i + 1]["content"])
elif message["role"] == Role.ASSISTANT.value:
elements += self.format_assistant.apply(content=message["content"])
elif message["role"] == Role.OBSERVATION.value:
Expand Down

0 comments on commit 6ca8c1a

Please sign in to comment.