From bf8625e70b63920fc8a35b5f05b0b082cd9723d4 Mon Sep 17 00:00:00 2001 From: Philip May Date: Mon, 9 Nov 2020 15:00:59 +0100 Subject: [PATCH] add evaluate doc - trainer.evaluate returns 'epoch' from training (#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> --- src/transformers/trainer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/transformers/trainer.py b/src/transformers/trainer.py index 8166b2ed06..05c1a5613a 100755 --- a/src/transformers/trainer.py +++ b/src/transformers/trainer.py @@ -1297,7 +1297,8 @@ class Trainer: :obj:`__len__` method. Returns: - A dictionary containing the evaluation loss and the potential metrics computed from the predictions. + A dictionary containing the evaluation loss and the potential metrics computed from the predictions. The + dictionary also contains the epoch number which comes from the training state. """ if eval_dataset is not None and not isinstance(eval_dataset, collections.abc.Sized): raise ValueError("eval_dataset must implement __len__")