trl icon indicating copy to clipboard operation
trl copied to clipboard

Error because of .map in _prepare_non_packed_dataset in sft_trainer.py

Open MaggieK410 opened this issue 3 years ago • 1 comments

Hello, I would like to finetune falcon 40b using the SFTTrainer. I have a custom dataset (which is a pandas Dataframe with two columns: prompts and labels). Now, I would like to use the SFTTrainer without packing, so I have added a formatting_prompts_function (analogue to here: https://github.com/lvwerra/trl/pull/444). The .map function in line 307 in sft_trainer.py seems to cause an issue, since DataFrame does not have a .map attribute. I have tried changing the datatype to dict, list and a custom dataset class that inherits from torch.utils.data.Dataset, but nothing has worked so far.

I would really appreciate, if anyone could tell me, what datatype is expected here ? Thank you very much! :)

MaggieK410 avatar Jun 24 '23 20:06 MaggieK410

Okay, so I realized that the function would like to have a Huggingface Dataset, now it works!

MaggieK410 avatar Jun 24 '23 21:06 MaggieK410