From b18e31407c1e0933a51c0e53f7777b6a47d034f8 Mon Sep 17 00:00:00 2001 From: Leandro von Werra Date: Tue, 24 Oct 2023 14:56:00 +0200 Subject: [PATCH] add info on TRL docs (#27024) * add info on TRL docs * add TRL link * tweak text * tweak text --- docs/source/en/main_classes/trainer.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/en/main_classes/trainer.md b/docs/source/en/main_classes/trainer.md index f433b820af..46341804ce 100644 --- a/docs/source/en/main_classes/trainer.md +++ b/docs/source/en/main_classes/trainer.md @@ -18,6 +18,12 @@ rendered properly in your Markdown viewer. The [`Trainer`] class provides an API for feature-complete training in PyTorch for most standard use cases. It's used in most of the [example scripts](https://github.com/huggingface/transformers/tree/main/examples). + + +If you're looking to fine-tune a language model like Llama-2 or Mistral on a text dataset using autoregressive techniques, consider using [`trl`](https://github.com/huggingface/trl)'s [`~trl.SFTTrainer`]. The [`~trl.SFTTrainer`] wraps the [`Trainer`] and is specially optimized for this particular task and supports sequence packing, LoRA, quantization, and DeepSpeed for efficient scaling to any model size. On the other hand, the [`Trainer`] is a more versatile option, suitable for a broader spectrum of tasks. + + + Before instantiating your [`Trainer`], create a [`TrainingArguments`] to access all the points of customization during training. The API supports distributed training on multiple GPUs/TPUs, mixed precision through [NVIDIA Apex](https://github.com/NVIDIA/apex) and Native AMP for PyTorch.