From 1bc811673ffc155d102a0e0ef74eff05c2ab4c13 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Wed, 28 Sep 2022 23:44:06 +0200 Subject: Fix decode bug --- text_recognizer/models/transformer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'text_recognizer/models/transformer.py') diff --git a/text_recognizer/models/transformer.py b/text_recognizer/models/transformer.py index b2e5d5f..f6f10a7 100644 --- a/text_recognizer/models/transformer.py +++ b/text_recognizer/models/transformer.py @@ -95,8 +95,8 @@ class LitTransformer(LitBase): Tensor: A tensor of token indices of the predictions from the model. """ start_index = self.tokenizer.start_index - end_index = self.tokenizer.start_index - pad_index = self.tokenizer.start_index + end_index = self.tokenizer.end_index + pad_index = self.tokenizer.pad_index bsz = x.shape[0] # Encode image(s) to latent vectors. -- cgit v1.2.3-70-g09d2