Open pratikkorat26 opened 3 years ago
i just try to run your code then i found an error called not know keywards argument {"pad_to_max_len} is not recognized
class CustomDataset(Dataset):
def __init__(self , review , target): super(CustomDataset , self).__init__() self.review = review self.target = target self.tokenizer = config.TOKENIZER self.max_len = config.MAX_LEN self.train_encodings = self.tokenizer(review, truncation=True, padding=True) def __len__(self): return len(self.review) def __getitem__(self, idx): item = {key: torch.tensor(val[idx]) for key, val in self.train_encodings.items()} item['labels'] = torch.tensor(self.target[idx]) return item
just look at this this can be helpfull
i just try to run your code then i found an error called not know keywards argument {"pad_to_max_len} is not recognized
class CustomDataset(Dataset):
just look at this this can be helpfull