Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xianxl committed Sep 30, 2024
1 parent e4f4f79 commit 6ff259b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Below is a conversation between an user and an AI Assistant.
Below is a conversation between a user and an AI Assistant.

[User Question]
{input}
Expand Down
5 changes: 4 additions & 1 deletion projects/self_taught_evaluator/src/prepare_dpo_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def pair_sampling(outputs, labels):
def get_input_key(response):
input_key = response["text"]
system_prompt, eval_example = input_key.split("\n\n[User Question]")
input_key = f"<|eot_id|><|start_header_id|>user<|end_header_id|>\n\n[User Question]{eval_example}"
next_turn_tag = "<|eot_id|><|start_header_id|>user<|end_header_id|>"
if system_prompt.endswith(next_turn_tag):
system_prompt = system_prompt[: -len(next_turn_tag)]
input_key = f"{next_turn_tag}\n\n[User Question]{eval_example}"
return system_prompt, input_key


Expand Down

0 comments on commit 6ff259b

Please sign in to comment.