def METHOD_NAME(self, preds: Union[str, Sequence[str]], target: Union[str, Sequence[str]]) -> None:
    """Update state with predictions and targets."""
    distance = _edit_distance_update(preds, target, self.substitution_cost)
    if self.reduction == "none" or self.reduction is None:
        self.edit_scores_list.append(distance)
    else:
        self.edit_scores += distance.sum()
        self.num_elements += distance.shape[0]