There’s a few *Trainer
objects available from transformers
, trl
and setfit
.
Other than the standard answer of “it depends on the task and which library you want to use”, what is the best practice or general guidelines when choosing which *Trainer
object to use to train/tune our models?
Together with the *Trainer
object, sometimes we see suggestions to use *TrainingArguments
or the vanilla TrainingArguments
.
For reference, we have:
- fine-tuning llama,
- https://github.com/philschmid/huggingface-llama-2-samples/blob/master/training/scripts/run_clm.py suggests vanilla
Trainer
- https://github.com/philschmid/huggingface-llama-2-samples/blob/master/training/scripts/run_clm.py suggests vanilla
- few-shot learning,
- SetFit: Efficient Few-Shot Learning Without Prompts suggests
from setfit import SetFitTrainer
- SetFit: Efficient Few-Shot Learning Without Prompts suggests
- machine translation
- reinforcement learning
- Supervised Fine-tuning Trainer suggests
from trl import SFTTrainer
- Supervised Fine-tuning Trainer suggests