Skip to content

Commit e7a23e8

Browse files
PhilipMaysgugger
authored andcommitted
add evaluate doc - trainer.evaluate returns 'epoch' from training (huggingface#8273)
* add evaluate doc * fix style with utils/style.doc * Update src/transformers/trainer.py Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
1 parent 421c36e commit e7a23e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/transformers/trainer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,8 @@ def evaluate(self, eval_dataset: Optional[Dataset] = None) -> Dict[str, float]:
12971297
:obj:`__len__` method.
12981298
12991299
Returns:
1300-
A dictionary containing the evaluation loss and the potential metrics computed from the predictions.
1300+
A dictionary containing the evaluation loss and the potential metrics computed from the predictions. The
1301+
dictionary also contains the epoch number which comes from the training state.
13011302
"""
13021303
if eval_dataset is not None and not isinstance(eval_dataset, collections.abc.Sized):
13031304
raise ValueError("eval_dataset must implement __len__")

0 commit comments

Comments
 (0)