Skip to content

Commit 63c922d

Browse files
committed
linter
1 parent b792073 commit 63c922d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lightning/pytorch/loops/training_epoch_loop.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414
import math
1515
from collections import OrderedDict
16+
from contextlib import suppress
1617
from dataclasses import dataclass
1718
from typing import Any, Optional, Union
1819

@@ -279,7 +280,7 @@ def advance(self, data_fetcher: _DataFetcher) -> None:
279280
from lightning.pytorch.utilities.exceptions import SIGTERMException
280281

281282
if dist.is_available() and dist.is_initialized() and self.trainer.world_size > 1:
282-
try:
283+
with suppress(Exception): # never crash CI
283284
sigterm_tensor = torch.tensor(
284285
[1 if getattr(self.trainer, "received_sigterm", False) else 0],
285286
device=self.trainer.strategy.root_device,
@@ -289,8 +290,6 @@ def advance(self, data_fetcher: _DataFetcher) -> None:
289290
if sigterm_tensor.item() == 1:
290291
dist.barrier()
291292
raise SIGTERMException()
292-
except Exception:
293-
pass # never crash CI
294293
# =====================================================================
295294

296295
if using_dataloader_iter := isinstance(data_fetcher, _DataLoaderIterDataFetcher):

src/lightning/pytorch/trainer/connectors/callback_connector.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ def _configure_checkpoint_callbacks(self, enable_checkpointing: bool) -> None:
106106
model_checkpoint = LitModelCheckpoint(model_registry=self.trainer._model_registry)
107107
else:
108108
rank_zero_info(
109-
"Using default `ModelCheckpoint`. Consider installing `litmodels` package to enable"
110-
" `LitModelCheckpoint` for automatic upload to the Lightning model registry."
109+
"💡 Tip: For seamless cloud uploads and versioning,"
110+
" try installing [litmodels](https://pypi.org/project/litmodels/) to enable LitModelCheckpoint,"
111+
" which syncs automatically with the Lightning model registry."
111112
)
112113
model_checkpoint = ModelCheckpoint()
113114
self.trainer.callbacks.append(model_checkpoint)

0 commit comments

Comments
 (0)