Skip to content

Commit e0b0fa7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 723a47b commit e0b0fa7

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pytorch_lightning/loggers/wandb.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,11 @@ def version(self) -> Optional[str]:
250250

251251
def after_save_checkpoint(self, checkpoint_callback: "ReferenceType[ModelCheckpoint]") -> None:
252252
# log checkpoints as artifacts
253-
if self._log_model == "all" or (self._log_model is True and checkpoint_callback.save_top_k == -1) \
254-
or self._log_model == 'best_and_last':
253+
if (
254+
self._log_model == "all"
255+
or (self._log_model is True and checkpoint_callback.save_top_k == -1)
256+
or self._log_model == "best_and_last"
257+
):
255258
self._scan_and_log_checkpoints(checkpoint_callback)
256259
elif self._log_model is True:
257260
self._checkpoint_callback = checkpoint_callback
@@ -305,10 +308,10 @@ def _scan_and_log_checkpoints(self, checkpoint_callback: "ReferenceType[ModelChe
305308
# remember logged models - timestamp needed in case filename didn't change (lastkckpt or custom name)
306309
self._logged_model_time[p] = t
307310

308-
if self._log_model == 'best_and_last':
311+
if self._log_model == "best_and_last":
309312
# Clean up previous artifacts.
310313
# Adapted from https://gitbook-docs.wandb.ai/guides/artifacts/api#cleaning-up-unused-versions
311-
api = wandb.Api(overrides={'project': self.experiment.project})
314+
api = wandb.Api(overrides={"project": self.experiment.project})
312315

313316
for version in api.artifact_versions(f"model-{self.experiment.id}", "model"):
314317
# Clean up all versions that don't have an alias such as 'latest'.

tests/trainer/loops/test_training_loop.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def training_epoch_end(self, outputs) -> None:
191191

192192

193193
def test_batch_loop_releases_loss(tmpdir):
194-
"""Test that loss/graph is released so that it can be garbage collected before the next training step"""
194+
"""Test that loss/graph is released so that it can be garbage collected before the next training step."""
195195

196196
class TestModel(BoringModel):
197197
def training_step(self, batch, batch_idx):

0 commit comments

Comments
 (0)