In trl SFTTrainer you can pass dataset with only ["messages"] and follows system/user/assistant standard messages style.
but UnslothSFTTrainer is not synced with recent versions of SFTTrainer and have struggle:
File "/workspace/unsloth-ft/wtf.py", line 45, in <module>
test_labelonly()
File "/workspace/unsloth-ft/wtf.py", line 21, in test_labelonly
trainer = SFTTrainer(
^^^^^^^^^^^
File "/workspace/miniconda3/envs/persona/lib/python3.12/site-packages/unsloth/trainer.py", line 209, in new_init
original_init(self, *args, **kwargs)
File "/workspace/unsloth-ft/unsloth_compiled_cache/UnslothSFTTrainer.py", line 1219, in __init__
super().__init__(
File "/workspace/unsloth-ft/unsloth_compiled_cache/UnslothSFTTrainer.py", line 628, in __init__
train_dataset = self._prepare_dataset(
^^^^^^^^^^^^^^^^^^^^^^
File "/workspace/unsloth-ft/unsloth_compiled_cache/UnslothSFTTrainer.py", line 828, in _prepare_dataset
raise RuntimeError("Unsloth: You must specify a `formatting_func`")
RuntimeError: Unsloth: You must specify a `formatting_func`
In trl SFTTrainer you can pass dataset with only ["messages"] and follows system/user/assistant standard messages style.
but UnslothSFTTrainer is not synced with recent versions of SFTTrainer and have struggle: