Skip to content

Commit 63898f7

Browse files
author
TOPAPEC
committed
fix: mypy type errors for requests import and Trainer callbacks
1 parent 8ffd648 commit 63898f7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

benchmark/compare_sasrec_unisrec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
import numpy as np
2626
import pandas as pd
27-
import requests
27+
import requests # type: ignore[import-untyped]
2828
import torch
2929
from tqdm import tqdm
3030

rectools/fast_transformers/unisrec/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import pytorch_lightning as pl
99
import torch
10-
from pytorch_lightning.callbacks import EarlyStopping
10+
from pytorch_lightning.callbacks import Callback, EarlyStopping
1111
from torch.utils.data import DataLoader
1212

1313
from ..preprocessing import SequenceBatchDataset, align_embeddings, build_sequences
@@ -178,7 +178,7 @@ def _arch_kwargs(self) -> tp.Dict[str, tp.Any]:
178178

179179
def _make_trainer(self, max_epochs: int, val_dl: tp.Any = None) -> pl.Trainer:
180180
"""Create a PyTorch Lightning Trainer."""
181-
callbacks = []
181+
callbacks: tp.List[Callback] = []
182182
if self.patience is not None and val_dl is not None:
183183
callbacks.append(EarlyStopping(monitor="val_loss", patience=self.patience, mode="min"))
184184

0 commit comments

Comments
 (0)