add rlhf-v dataset

This commit is contained in:
hiyouga committed 2024-09-01 22:57:41 +08:00
1 parent 55027282cd
commit 8e49940746
13 files changed
+118 -33

No files matched your search

-1
View File
@@ -176,7 +176,6 @@ class CustomDPOTrainer(DPOTrainer):
batch = {k: v.detach().clone() for k, v in batch.items()} # avoid error
all_logits: "torch.Tensor" = model(**batch, return_dict=True, use_cache=False).logits.to(torch.float32)
all_logps, valid_length = get_batch_logps(logits=all_logits, labels=batch["labels"])
if self.loss_type in ["ipo", "orpo", "simpo"]:
all_logps = all_logps / valid_length