From ffa4be4bf4e3758e01d52a9c1f354a05a90b93de Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 15 Apr 2021 22:05:24 +0200 Subject: Created mappings --- text_recognizer/networks/image_transformer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'text_recognizer/networks') diff --git a/text_recognizer/networks/image_transformer.py b/text_recognizer/networks/image_transformer.py index daededa..a6aaca4 100644 --- a/text_recognizer/networks/image_transformer.py +++ b/text_recognizer/networks/image_transformer.py @@ -44,7 +44,9 @@ class ImageTransformer(nn.Module): dropout_rate: float = 0.1, transformer_activation: str = "glu", ) -> None: - self.vocab_size = NUM_WORD_PIECES + NUM_SPECIAL_TOKENS if vocab_size is None else vocab_size + self.vocab_size = ( + NUM_WORD_PIECES + NUM_SPECIAL_TOKENS if vocab_size is None else vocab_size + ) self.hidden_dim = hidden_dim self.max_output_length = output_shape[0] -- cgit v1.2.3-70-g09d2