From f887206be24b79a819d4a215bd0b4f31d8522e34 Mon Sep 17 00:00:00 2001 From: AlexShen-Oguri <176059206+AlexShen-Oguri@users.noreply.github.com> Date: Mon, 30 Nov 2026 20:27:10 -0500 Subject: [PATCH] Fix the Transformers integration guide setup Install the Trainer and accuracy metric dependencies, use the current tokenizer parameter, and link TrainingArguments. Co-authored-by: OpenAI Codex --- docs/source/transformers_integrations.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/transformers_integrations.mdx b/docs/source/transformers_integrations.mdx index 6798775a..cf87f487 100644 --- a/docs/source/transformers_integrations.mdx +++ b/docs/source/transformers_integrations.mdx @@ -3,12 +3,12 @@ To run the 🤗 Transformers examples make sure you have installed the following libraries: ```bash -pip install datasets transformers torch evaluate nltk rouge_score +pip install datasets transformers torch accelerate evaluate nltk rouge_score scikit-learn ``` ## Trainer -The metrics in `evaluate` can be easily integrated with the [`~transformers.Trainer`]. The `Trainer` accepts a `compute_metrics` keyword argument that passes a function to compute metrics. One can specify the evaluation interval with `eval_strategy` in the [`~transformers.TrainerArguments`], and based on that, the model is evaluated accordingly, and the predictions and labels passed to `compute_metrics`. +The metrics in `evaluate` can be easily integrated with the [`~transformers.Trainer`]. The `Trainer` accepts a `compute_metrics` keyword argument that passes a function to compute metrics. One can specify the evaluation interval with `eval_strategy` in the [`~transformers.TrainingArguments`], and based on that, the model is evaluated accordingly, and the predictions and labels passed to `compute_metrics`. ```python from datasets import load_dataset @@ -121,7 +121,7 @@ trainer = Seq2SeqTrainer( args=training_args, train_dataset=tokenized_billsum["train"], eval_dataset=tokenized_billsum["test"], - tokenizer=tokenizer, + processing_class=tokenizer, data_collator=data_collator, compute_metrics=compute_metrics )