Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 10, 2024
1 parent fc3e0e0 commit 3fd3a4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lightning/pytorch/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import os
from contextlib import contextmanager
from datetime import timedelta
from typing import Any, Dict, Generator, Iterable, List, Optional, Union, Callable
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Union
from weakref import proxy

import torch
Expand Down Expand Up @@ -127,7 +127,7 @@ def __init__(
sync_batchnorm: bool = False,
reload_dataloaders_every_n_epochs: int = 0,
default_root_dir: Optional[_PATH] = None,
compile_fn: Optional[Callable] = None
compile_fn: Optional[Callable] = None,
) -> None:
r"""Customize every aspect of training via flags.
Expand Down Expand Up @@ -470,7 +470,7 @@ def __init__(
self.state = TrainerState()

self.compile_fn = compile_fn

# configure profiler
setup._init_profiler(self, profiler)

Expand Down Expand Up @@ -962,7 +962,7 @@ def _run(
# compile if compile_fn provided after configured strategy
if self.compile_fn is not None:
self.strategy.model = self.compile_fn(self.strategy.model)

# hook
if self.state.fn == TrainerFn.FITTING:
call._call_callback_hooks(self, "on_fit_start")
Expand Down

0 comments on commit 3fd3a4f

Please sign in to comment.