Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Find import bugs in "lightnin_examples/text-transformers.py" #97

@hankyul2

Description

@hankyul2

🐛 Bug

I cannot import pytorch-lightning in colab.
The file name that has error is text-transformer.ipynb (can be found in jupyter link, colab link)

To Reproduce

Steps to reproduce the behavior:

  1. Open text-transformer.ipynb in colab (colab link)
  2. Execute first and second code block
  3. If you execute second code block, it will show you import error.

image

Expected behavior

If I import pytorch-lightning, it should be imported without error.

Solution

I tried to solve this problem myself and I somehow find that error is occurred, because torchtext version is lower than expected.
So If you add torchtext>=0.9 in import statement, error can be fixed.

! pip install --quiet "datasets" "scipy" "torchmetrics>=0.3" "transformers" "scikit-learn" "torch>=1.6, <1.9" "torchtext>=0.9" "pytorch_lightning>=1.3"

If you find my solution is good, let me know I will make a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug / fixSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions