You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "dpo_lora.py", line 70, in <module>
trainer.train()
^^^^^^^^^^^^^^^
File ".venv/env/lib/python3.11/site-packages/transformers/trainer.py", line 2122, in train
return inner_training_loop(
^^^^^^^^^^^^^^^^^^^^
File ".venv/env/lib/python3.11/site-packages/transformers/trainer.py", line 2426, in _inner_training_loop
batch_samples, num_items_in_batch = self.get_batch_samples(epoch_iterator, num_batches)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/env/lib/python3.11/site-packages/trl/trainer/dpo_trainer.py", line 1508, in get_batch_samples
policy_output = model.generate(
^^^^^^^^^^^^^^
AttributeError: 'generator' object has no attribute 'generate'
Expected behavior
It seems to be due to the recent commit 6ba31a8 on Oct 17, 2024 "Enable users to use their own loss functions + deal with prefetching for grad accum (huggingface/transformers#34198)" on Transformers 4.46.0
where a new method get_batch_samples is defined and used by _inner_training_loop
But the subclass DPOTrainer overwrites the method get_batch_samples with a different signature (and output).
Error can be avoided with Transformers==4.45.2 and trl==0.11.4
The text was updated successfully, but these errors were encountered:
System Info
System Info
Information
Tasks
examples
folderReproduction
Code to reproduce the error (with transformers==4.46.0 and trl==0.11.4)
This error is raised:
Expected behavior
It seems to be due to the recent commit 6ba31a8 on Oct 17, 2024 "Enable users to use their own loss functions + deal with prefetching for grad accum (huggingface/transformers#34198)" on Transformers 4.46.0
where a new method get_batch_samples is defined and used by _inner_training_loop
But the subclass DPOTrainer overwrites the method get_batch_samples with a different signature (and output).
Error can be avoided with Transformers==4.45.2 and trl==0.11.4
The text was updated successfully, but these errors were encountered: