Skip to content

Commit

Permalink
Fix typing error in Trainer class (prediction_step) (huggingface#11138)
Browse files Browse the repository at this point in the history
* fix: docstrings in prediction_step

* ci: Satisfy line length requirements

* ci: character length requirements
  • Loading branch information
jannisborn authored and Iwontbecreative committed Jul 15, 2021
1 parent 3224bff commit 07606ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/transformers/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ def prediction_step(
inputs: Dict[str, Union[torch.Tensor, Any]],
prediction_loss_only: bool,
ignore_keys: Optional[List[str]] = None,
) -> Tuple[Optional[float], Optional[torch.Tensor], Optional[torch.Tensor]]:
) -> Tuple[Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor]]:
"""
Perform an evaluation step on :obj:`model` using obj:`inputs`.
Expand All @@ -1987,8 +1987,8 @@ def prediction_step(
gathering predictions.
Return:
Tuple[Optional[float], Optional[torch.Tensor], Optional[torch.Tensor]]: A tuple with the loss, logits and
labels (each being optional).
Tuple[Optional[torch.Tensor], Optional[torch.Tensor], Optional[torch.Tensor]]: A tuple with the loss,
logits and labels (each being optional).
"""
has_labels = all(inputs.get(k) is not None for k in self.label_names)
inputs = self._prepare_inputs(inputs)
Expand Down

0 comments on commit 07606ce

Please sign in to comment.