src/transformers/configuration_utils.py/PretrainedConfig/num_labels
class PretrainedConfig:    def num_labels(self) -> int:
        """
        :obj:`int`: The number of labels for classification models.
        """
        return len(self.id2label)