From 191b74d3d9ef2a46933e79a1688bb5c99a7bae93 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 11 Oct 2021 22:10:08 +0200 Subject: Remove mapping from transformer lit models --- text_recognizer/models/transformer.py | 3 --- text_recognizer/models/vq_transformer.py | 2 -- 2 files changed, 5 deletions(-) (limited to 'text_recognizer/models') diff --git a/text_recognizer/models/transformer.py b/text_recognizer/models/transformer.py index 0acc30a..50bf73d 100644 --- a/text_recognizer/models/transformer.py +++ b/text_recognizer/models/transformer.py @@ -5,7 +5,6 @@ import attr import torch from torch import Tensor -from text_recognizer.data.base_mapping import AbstractMapping from text_recognizer.models.metrics import CharacterErrorRate from text_recognizer.models.base import BaseLitModel @@ -14,8 +13,6 @@ from text_recognizer.models.base import BaseLitModel class TransformerLitModel(BaseLitModel): """A PyTorch Lightning model for transformer networks.""" - mapping: Type[AbstractMapping] = attr.ib() - max_output_len: int = attr.ib(default=451) start_token: str = attr.ib(default="") end_token: str = attr.ib(default="") diff --git a/text_recognizer/models/vq_transformer.py b/text_recognizer/models/vq_transformer.py index b419e97..c07efa4 100644 --- a/text_recognizer/models/vq_transformer.py +++ b/text_recognizer/models/vq_transformer.py @@ -5,7 +5,6 @@ import attr import torch from torch import Tensor -from text_recognizer.data.base_mapping import AbstractMapping from text_recognizer.models.transformer import TransformerLitModel @@ -13,7 +12,6 @@ from text_recognizer.models.transformer import TransformerLitModel class VqTransformerLitModel(TransformerLitModel): """A PyTorch Lightning model for transformer networks.""" - mapping: Type[AbstractMapping] = attr.ib() alpha: float = attr.ib(default=1.0) def forward(self, data: Tensor) -> Tensor: -- cgit v1.2.3-70-g09d2