From f0dec874f08a236ffa8b33d009dbcfa27122ddac Mon Sep 17 00:00:00 2001 From: secrettoad Date: Mon, 2 Dec 2024 11:39:09 -0800 Subject: [PATCH] add docstring example for compute_loss_func (#35020) --- src/transformers/trainer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py index e9d1c770a89541..13d9d45f19a88f 100755 --- a/src/transformers/trainer.py +++ b/src/transformers/trainer.py @@ -360,8 +360,7 @@ class Trainer: inner layers, dropout probabilities etc). compute_loss_func (`Callable`, *optional*): A function that accepts the raw model outputs, labels, and the number of items in the entire accumulated - batch (batch_size * gradient_accumulation_steps) and returns the loss. For example, here is one using - the loss function from `transformers` + batch (batch_size * gradient_accumulation_steps) and returns the loss. For example, see the default [loss function](https://github.com/huggingface/transformers/blob/052e652d6d53c2b26ffde87e039b723949a53493/src/transformers/trainer.py#L3618) used by [`Trainer`]. compute_metrics (`Callable[[EvalPrediction], Dict]`, *optional*): The function that will be used to compute metrics at evaluation. Must take a [`EvalPrediction`] and return a dictionary string to metric values. *Note* When passing TrainingArgs with `batch_eval_metrics` set to