fix bug in data loader, support dpo eval

Former-commit-id: b355f6cac9
This commit is contained in:
hiyouga
2023-11-03 00:34:26 +08:00
parent b2bf10661b
commit 5507014392
3 changed files with 9 additions and 2 deletions

View File

@@ -82,8 +82,8 @@ def get_dataset(
assistant_role = msg_list[idx + 1][dataset_attr.role]
else:
if (
msg_list[idx][dataset_attr.query] != user_role
or msg_list[idx+1][dataset_attr.query] != assistant_role
msg_list[idx][dataset_attr.role] != user_role
or msg_list[idx+1][dataset_attr.role] != assistant_role
):
raise ValueError("Only accepts conversation in u/a/u/a/u/a order.")
msg_pairs.append((msg_list[idx][dataset_attr.content], msg_list[idx + 1][dataset_attr.content]))