Skip to content

Commit

Permalink
update mypy version (#524)
Browse files Browse the repository at this point in the history
Summary:
Our CI is failing ([ex](https://github.com/facebookresearch/multimodal/actions/runs/7934357313/job/21665167793?pr=521)) due to a mismatch in the mypy version used with pytorch core. Update mypy version to fix it

Pull Request resolved: #524

Test Plan:
Fresh install and run mypy

```
conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch-nightly -c nvidia
pip install -e ".[dev]"
mypy
Success: no issues found in 135 source files
```

CI is green now

Reviewed By: kartikayk

Differential Revision: D54050126

Pulled By: ebsmothers

fbshipit-source-id: 922e0a555c14af6f2f27953603b8d280c513f5ff
  • Loading branch information
ebsmothers authored and facebook-github-bot committed Feb 22, 2024
1 parent 5a6a283 commit c261d71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ black==22.12.0
flake8-bugbear==22.4.25
flake8==4.0.1
iopath
mypy==1.0.1
mypy==1.8.0
pep8-naming==0.12.1
pre-commit
pytest
Expand Down
6 changes: 3 additions & 3 deletions torchmultimodal/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def momentum_update(model: nn.Module, model_m: nn.Module, momentum: float) -> No

class ModelOutput(OrderedDict):
def keys(self) -> Any:
for field in fields(self):
for field in fields(self): # type: ignore
yield field.name

def __getitem__(self, key: Any) -> Any:
Expand All @@ -131,11 +131,11 @@ def __iter__(self) -> Any:
yield from self.keys()

def values(self) -> Any:
for field in fields(self):
for field in fields(self): # type: ignore
yield getattr(self, field.name)

def items(self) -> Any:
for field in fields(self):
for field in fields(self): # type: ignore
yield field.name, getattr(self, field.name)


Expand Down

0 comments on commit c261d71

Please sign in to comment.