diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc18080a..8f6600a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,16 +1,16 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.4.0 + rev: v4.4.0 hooks: - id: check-yaml - id: trailing-whitespace - id: end-of-file-fixer - repo: https://github.com/timothycrosley/isort - rev: 5.6.4 + rev: 5.12.0 hooks: - id: isort args: [--profile, black] - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.1.0 hooks: - id: black diff --git a/README.md b/README.md index cba1edd2..4748b8be 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ [![Coverage](https://img.shields.io/codecov/c/github/jpuigcerver/PyLaia?&label=Coverage&logo=Codecov&logoColor=ffffff&labelColor=f01f7a)](https://codecov.io/gh/jpuigcerver/PyLaia) [![Code quality](https://img.shields.io/codefactor/grade/github/jpuigcerver/PyLaia?&label=CodeFactor&logo=CodeFactor&labelColor=2782f7)](https://www.codefactor.io/repository/github/jpuigcerver/PyLaia) -[![Python: 3.6+](https://img.shields.io/badge/Python-3.6%2B-FFD43B.svg?&logo=Python&logoColor=white&labelColor=306998)](https://www.python.org/) -[![PyTorch: 1.4.0+](https://img.shields.io/badge/PyTorch-1.4.0%2B-8628d5.svg?&logo=PyTorch&logoColor=white&labelColor=%23ee4c2c)](https://pytorch.org/) +[![Python: 3.8+](https://img.shields.io/badge/Python-3.8%2B-FFD43B.svg?&logo=Python&logoColor=white&labelColor=306998)](https://www.python.org/) +[![PyTorch: 1.13.0+](https://img.shields.io/badge/PyTorch-1.13.0%2B-8628d5.svg?&logo=PyTorch&logoColor=white&labelColor=%23ee4c2c)](https://pytorch.org/) [![pre-commit: enabled](https://img.shields.io/badge/pre--commit-enabled-76877c?&logo=pre-commit&labelColor=1f2d23)](https://github.com/pre-commit/pre-commit) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?)](https://github.com/ambv/black) diff --git a/laia/callbacks/decode.py b/laia/callbacks/decode.py index 01ba886d..2bd9725f 100644 --- a/laia/callbacks/decode.py +++ b/laia/callbacks/decode.py @@ -84,7 +84,6 @@ def on_test_batch_end(self, trainer, pl_module, outputs, batch, *args): word_probs = [] for i, (img_id, hyp) in enumerate(zip(img_ids, hyps)): - if self.use_symbols: hyp = [self.syms[v] for v in hyp] if self.convert_spaces: @@ -96,7 +95,6 @@ def on_test_batch_end(self, trainer, pl_module, outputs, batch, *args): hyp = self.join_string.join(str(x) for x in hyp).strip() if self.print_confidence_scores: - if self.print_word_confidence_scores: word_prob = [f"{prob:.2f}" for prob in word_probs[i]] self.write( diff --git a/laia/decoders/ctc_language_decoder.py b/laia/decoders/ctc_language_decoder.py index f2beb0bc..765c6422 100644 --- a/laia/decoders/ctc_language_decoder.py +++ b/laia/decoders/ctc_language_decoder.py @@ -33,7 +33,6 @@ def __init__( unk_token: str = "", sil_token: str = "", ): - self.decoder = ctc_decoder( lm=language_model_path, lexicon=lexicon_path, diff --git a/laia/nn/resnet.py b/laia/nn/resnet.py index 8ef84d23..cdd008df 100644 --- a/laia/nn/resnet.py +++ b/laia/nn/resnet.py @@ -128,7 +128,6 @@ def __init__( width_per_group: int = 64, norm_layer: Optional[Type[nn.Module]] = None, ): - if len(layers) != 4: raise ValueError("The length of layers should be 4") diff --git a/requirements.txt b/requirements.txt index 944810e7..4162e53a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,8 +6,8 @@ matplotlib # cpu version: nnutils-pytorch nnutils-pytorch-cuda pytorch-lightning==1.1.0 -torch>=1.13<1.14 -torchvision>=0.14<0.15 -torchaudio>=0.13<0.14 +torch>=1.13,<1.14 +torchvision>=0.14,<0.15 +torchaudio>=0.13,<0.14 jsonargparse[signatures]==4.7 dataclasses; python_version < '3.7'