diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-11 22:10:08 +0200 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2021-10-11 22:10:08 +0200 |
commit | 191b74d3d9ef2a46933e79a1688bb5c99a7bae93 (patch) | |
tree | ed4466f71f2740b81850957cb659e6d7fa46e826 | |
parent | 7e0a0a39a54fd7d1a69b9f12bbd98a2b16285c9c (diff) |
Remove mapping from transformer lit models
-rw-r--r-- | text_recognizer/models/transformer.py | 3 | ||||
-rw-r--r-- | text_recognizer/models/vq_transformer.py | 2 |
2 files changed, 0 insertions, 5 deletions
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="<s>") end_token: str = attr.ib(default="<e>") 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: |