Skip to content

Commit

Permalink
Bump version of pytorch-lightning to 2.0.0 (#2087)
Browse files Browse the repository at this point in the history
* Bump version of pytorch-lightning to 2.0.0

* relax PL lower version and adapt progress bar import instead

* update changelog

* revert some changes to changelog

---------

Co-authored-by: dennisbader <[email protected]>
  • Loading branch information
eschibli and dennisbader authored Dec 1, 2023
1 parent 7cfdf62 commit b20a1f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ but cannot always guarantee backwards compatibility. Changes that may **break co
**Improved**

**Fixed**
- Fixed an import error when trying to create a `TorchForecastingModel` with PyTorch Lightning v<2.0.0. [#2087](https://github.com/unit8co/darts/pull/2087) by [Eschibli](https://github.com/eschibli).

### For developers of the library:

Expand Down
3 changes: 2 additions & 1 deletion darts/models/forecasting/torch_forecasting_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import pytorch_lightning as pl
import torch
from pytorch_lightning import loggers as pl_loggers
from pytorch_lightning.callbacks import ProgressBar
from torch import Tensor
from torch.utils.data import DataLoader

Expand Down Expand Up @@ -97,8 +96,10 @@
pl_200_or_above = int(tokens[0]) >= 2

if pl_200_or_above:
from pytorch_lightning.callbacks import ProgressBar
from pytorch_lightning.tuner import Tuner
else:
from pytorch_lightning.callbacks import ProgressBarBase as ProgressBar
from pytorch_lightning.tuner.tuning import Tuner


Expand Down

0 comments on commit b20a1f2

Please sign in to comment.