Skip to content

Commit 5d576dd

Browse files
Bordalexierule
authored andcommitted
update model message (#20753)
* update model message * nitpick_ignore (cherry picked from commit 6cf2581)
1 parent 77ff11d commit 5d576dd

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.github/workflows/docs-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
lfs: ${{ matrix.pkg-name == 'pytorch' }}
7373
- uses: actions/setup-python@v5
7474
with:
75-
python-version: "3.9"
75+
python-version: "3.10"
7676

7777
- name: List notebooks
7878
if: ${{ matrix.pkg-name == 'pytorch' }}

docs/source-fabric/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@
292292
("py:.*", "torch_xla.*"),
293293
("py:class", "transformer_engine.*"),
294294
("py:class", "bitsandbytes.*"),
295+
# loggers
296+
('py:class', 'tensorboardX.SummaryWriter'), # todo: this is unexpected as the imports locally works
295297
]
296298

297299
# -- Options for todo extension ----------------------------------------------

docs/source-pytorch/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ def _load_py_module(name: str, location: str) -> ModuleType:
377377
# missing in generated API
378378
("py:exc", "MisconfigurationException"),
379379
# TODO: generated list of all existing ATM, need to be fixed
380+
('py:class', 'tensorboardX.SummaryWriter'),
380381
("py:class", "AveragedModel"),
381382
("py:class", "CometExperiment"),
382383
("py:meth", "DataModule.__init__"),

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from datetime import timedelta
1919
from typing import Optional, Union
2020

21-
from lightning_utilities import module_available
21+
from lightning_utilities.core.imports import RequirementCache
2222

2323
import lightning.pytorch as pl
2424
from lightning.fabric.utilities.registry import _load_external_callbacks
@@ -93,7 +93,7 @@ def _configure_checkpoint_callbacks(self, enable_checkpointing: bool) -> None:
9393
" but found `ModelCheckpoint` in callbacks list."
9494
)
9595
elif enable_checkpointing:
96-
if module_available("litmodels") and self.trainer._model_registry:
96+
if RequirementCache("litmodels >=0.1.7") and self.trainer._model_registry:
9797
trainer_source = inspect.getmodule(self.trainer)
9898
if trainer_source is None or not isinstance(trainer_source.__package__, str):
9999
raise RuntimeError("Unable to determine the source of the trainer.")
@@ -103,12 +103,11 @@ def _configure_checkpoint_callbacks(self, enable_checkpointing: bool) -> None:
103103
else:
104104
from litmodels.integrations.checkpoints import LightningModelCheckpoint as LitModelCheckpoint
105105

106-
model_checkpoint = LitModelCheckpoint(model_name=self.trainer._model_registry)
106+
model_checkpoint = LitModelCheckpoint(model_registry=self.trainer._model_registry)
107107
else:
108108
rank_zero_info(
109-
"You are using the default ModelCheckpoint callback."
110-
" Install `litmodels` package to use the `LitModelCheckpoint` instead"
111-
" for seamless uploading to the Lightning model registry."
109+
"Using default `ModelCheckpoint`. Consider installing `litmodels` package to enable"
110+
" `LitModelCheckpoint` for automatic upload to the Lightning model registry."
112111
)
113112
model_checkpoint = ModelCheckpoint()
114113
self.trainer.callbacks.append(model_checkpoint)

0 commit comments

Comments
 (0)