Open the-utkarshjain opened 2 weeks ago
The solution is simple. Go to src/configs and add these lines:
import trl
(at the top of the file)SFTConfig(transformers.TrainingArguments)
to class SFTConfig(trl.SFTConfig)
Don't forget to install the handbook with python -m pip install -e .
(note the -e option or else your changes won't be read).
Thank you, @the-utkarshjain ! It took me a while to figure out TRL has switched and doesn't support the subclass of TrainingArguments
as its parameter right now.
We also need to fix the DPOConfig that has the same problem.
A quick fix is: pip install trl==0.8.2
This issue is in context with run_sft.py. Might occur with other tasks too.
The SFTTrainer class expects SFTConfig to be an instance of trl.SFTConfig. However, transformers.TrainingArguments is being passed. Due to this, the code usually throws an error when private variable of trl.SFTConfig like dataset_num_proc, etc are not passed. The bigger issue is that the code works with transformers.TrainingArguments, so you can't even pass those variables through the YAML file, or else the code throws an error saying there are extra arguments which aren't used by the program.