From c4fec90d135289715c379704dc4a3696a4c65ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Koz=C5=82owski?= Date: Wed, 25 Jan 2023 21:45:22 +0100 Subject: [PATCH] fix len --- utils/donut_dataset_stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/donut_dataset_stream.py b/utils/donut_dataset_stream.py index 46ddaaa..27b7971 100644 --- a/utils/donut_dataset_stream.py +++ b/utils/donut_dataset_stream.py @@ -116,8 +116,8 @@ class DonutDataset(Dataset): self.model.decoder.resize_token_embeddings(len(self.processor.tokenizer)) self.added_tokens.extend(list_of_tokens) - # def __len__(self) -> int: - # return self.dataset_length + def __len__(self) -> int: + return self.dataset_length def __getitem__(self, idx: int) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]: """