Skip to content

Commit

Permalink
Fix import bugs in text-transformers (Lightning-AI#103)
Browse files Browse the repository at this point in the history
* Fix import bugs in text-transformers.py
- Add torchtext version in .meta.yaml
* Update .meta.yml

Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
  • Loading branch information
hankyul2 and Borda authored Dec 3, 2021
1 parent 898b8b6 commit 2887239
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lightning_examples/text-transformers/.meta.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
title: Finetune Transformers Models with PyTorch Lightning
author: PL team
created: 2021-01-31
updated: 2021-06-21
updated: 2021-12-03
license: CC BY-SA
build: 1
build: 2
tags:
- Text
description: |
Expand All @@ -15,6 +15,7 @@ requirements:
- datasets
- scipy
- scikit-learn
- torchtext>=0.9
accelerator:
- CPU
- GPU
2 changes: 1 addition & 1 deletion lightning_examples/text-transformers/text-transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def setup(self, stage=None) -> None:
if stage != "fit":
return
# Get dataloader by calling it - train_dataloader() is called after setup() by default
train_loader = self.train_dataloader()
train_loader = self.trainer.datamodule.train_dataloader()

# Calculate total steps
tb_size = self.hparams.train_batch_size * max(1, self.trainer.gpus)
Expand Down

0 comments on commit 2887239

Please sign in to comment.