tofu
tofu copied to clipboard
One of the inputs missing for DPO loss
When I use dpo
as the forget loss, I encountered the following error:
Traceback (most recent call last):
File "/root/tofu/forget.py", line 187, in main
trainer.train()
File "/usr/local/lib/python3.10/dist-packages/transformers/trainer.py", line 1780, in train
return inner_training_loop(
File "/usr/local/lib/python3.10/dist-packages/transformers/trainer.py", line 2118, in _inner_training_loop
tr_loss_step = self.training_step(model, inputs)
File "/usr/local/lib/python3.10/dist-packages/transformers/trainer.py", line 3036, in training_step
loss = self.compute_loss(model, inputs)
File "/root/tofu/dataloader.py", line 149, in compute_loss
idk_inputs, forget_inputs, retain_inputs = inputs
ValueError: not enough values to unpack (expected 3, got 2)
After some inspection, I noticed that the inputs
variable only contains 2 elements instead of 3, leading to the error. I made no code modification and double-checked that TextForgetDatasetDPOQA
is used and has three items returned by __getitem__
. However, I wasn't able to trace the source of this error.