diff --git a/casanovo/casanovo.py b/casanovo/casanovo.py index 992cf566..552de1e7 100644 --- a/casanovo/casanovo.py +++ b/casanovo/casanovo.py @@ -357,6 +357,7 @@ def setup_model( try: model = _get_model_weights() except github.RateLimitExceededException: + logger.error( "GitHub API rate limit exceeded while trying to download the " "model weights. Please download compatible model weights " diff --git a/casanovo/denovo/model.py b/casanovo/denovo/model.py index 00931386..39d2027a 100644 --- a/casanovo/denovo/model.py +++ b/casanovo/denovo/model.py @@ -137,7 +137,9 @@ def __init__( max_charge=max_charge, ) self.softmax = torch.nn.Softmax(2) - self.celoss = torch.nn.CrossEntropyLoss(ignore_index=0, label_smoothing=train_label_smoothing) + self.celoss = torch.nn.CrossEntropyLoss( + ignore_index=0, label_smoothing=train_label_smoothing + ) self.val_celoss = torch.nn.CrossEntropyLoss(ignore_index=0) # Optimizer settings. self.warmup_iters = warmup_iters @@ -727,7 +729,7 @@ def training_step( """ pred, truth = self._forward_step(*batch) pred = pred[:, :-1, :].reshape(-1, self.decoder.vocab_size + 1) - if mode=="train": + if mode == "train": loss = self.celoss(pred, truth.flatten()) else: loss = self.val_celoss(pred, truth.flatten()) diff --git a/casanovo/denovo/model_runner.py b/casanovo/denovo/model_runner.py index b047525c..296ce90a 100644 --- a/casanovo/denovo/model_runner.py +++ b/casanovo/denovo/model_runner.py @@ -50,6 +50,7 @@ def __init__( self.trainer = None self.model = None self.loaders = None + self.writer = None # Configure checkpoints.