Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update pytorch-lightning requirement to >= 1.8.0 #202

Merged
merged 3 commits into from
Mar 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aitextgen/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import pytorch_lightning as pl
from pytorch_lightning.callbacks.progress import ProgressBarBase
from pytorch_lightning.utilities import _TPU_AVAILABLE
from pytorch_lightning.accelerators import TPUAccelerator


class ATGTransformer(pl.LightningModule):
Expand Down Expand Up @@ -187,7 +187,7 @@ def on_batch_end(self, trainer, pl_module):
self.main_progress_bar.update(self.progress_bar_refresh_rate)
self.main_progress_bar.set_description(desc)

if _TPU_AVAILABLE and self.save_every_check:
if TPUAccelerator.is_available() and self.save_every_check:
did_unfreeze = False
if self.enabled:
self.unfreeze_layers(pl_module)
Expand All @@ -198,7 +198,7 @@ def on_batch_end(self, trainer, pl_module):

if self.enabled:
did_unfreeze = False
if not _TPU_AVAILABLE and self.save_every_check:
if not TPUAccelerator.is_available() and self.save_every_check:
self.unfreeze_layers(pl_module)
self.save_pytorch_model(trainer, pl_module)
did_unfreeze = True
Expand Down