return_offsets_mapping, **kwargs) 1926 stack = tf.stack(stack, axis=0) 1927 elif return_tensors == "pt": -> 1928 stack = torch.stack(stack, dim=0) 1929 elif not return_tensors and len(stack) == 1: 1930 stack = stack[0] TypeError: expected Tensor as element 0 in argument 0...
''' + inputs = self.tokenizer(text, max_length=self.max_length, padding='max_length', truncation=True, + return_tensors="pt") + return { + 'input_ids': inputs['input_ids'].squeeze(0), + 'attention_mask': inputs['attention_mask'].squeeze(0), + 'labels': torch.tensor(label...
''' + inputs = self.tokenizer(text, max_length=self.max_length, padding='max_length', truncation=True, + return_tensors="pt") + return { + 'input_ids': inputs['input_ids'].squeeze(0), + 'attention_mask': inputs['attention_mask'].squeeze(0), + 'labels': torch.tensor(label...