def __call__(self, examples: List[Union[(List[int], torch.Tensor, Dict[(str, torch.Tensor)])]]) -> Dict[(str, torch.Tensor)]:
    if isinstance(examples[0], (dict, BatchEncoding)):
        batch = self.tokenizer.pad(examples, return_tensors='pt', pad_to_multiple_of=self.pad_to_multiple_of)
    else:
        batch = {'input_ids': _collate_batch(examples, self.tokenizer, pad_to_multiple_of=self.pad_to_multiple_of)}
    special_tokens_mask = batch.pop('special_tokens_mask', None)
    if self.mlm:
        (batch['input_ids'], batch['labels']) = self.mask_tokens(batch['input_ids'], special_tokens_mask=special_tokens_mask)
    else:
        labels = batch['input_ids'].clone()
        if (self.tokenizer.pad_token_id is not None):
            labels[(labels == self.tokenizer.pad_token_id)] = (- 100)
        batch['labels'] = labels
    return batch
def __call__(self, examples: List[Union[(List[int], torch.Tensor, Dict[(str, torch.Tensor)])]]) -> Dict[(str, torch.Tensor)]:
    if isinstance(examples[0], (dict, BatchEncoding)):
        batch = self.tokenizer.pad(examples, return_tensors='pt', pad_to_multiple_of=self.pad_to_multiple_of)
    else:
        batch = {'input_ids': _collate_batch(examples, self.tokenizer, pad_to_multiple_of=self.pad_to_multiple_of)}
    special_tokens_mask = batch.pop('special_tokens_mask', None)
    if self.mlm:
        (batch['input_ids'], batch['labels']) = self.mask_tokens(batch['input_ids'], special_tokens_mask=special_tokens_mask)
    else:
        labels = batch['input_ids'].clone()
        if (self.tokenizer.pad_token_id is not None):
            labels[(labels == self.tokenizer.pad_token_id)] = (- 100)
        batch['labels'] = labels
    return batch