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>
This commit is contained in:
Philip May
2020-11-09 15:00:59 +01:00
committed by GitHub
parent ebde57acac
commit bf8625e70b

View File

@@ -1297,7 +1297,8 @@ class Trainer:
:obj:`__len__` method. :obj:`__len__` method.
Returns: 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): if eval_dataset is not None and not isinstance(eval_dataset, collections.abc.Sized):
raise ValueError("eval_dataset must implement __len__") raise ValueError("eval_dataset must implement __len__")