minimaxir / aitextgen

A robust Python tool for text-based AI training and generation using GPT-2.
https://docs.aitextgen.io
MIT License
1.84k stars 220 forks source link

error while trying import aitextgen #208

Open dogukan33 opened 1 year ago

dogukan33 commented 1 year ago

from aitextgen import aitextgen gives the error below...

Output exceeds the size limit. Open the full output data in a text editor

ImportError Traceback (most recent call last) Cell In[7], line 1 ----> 1 from aitextgen import aitextgen

File /opt/homebrew/lib/python3.10/site-packages/aitextgen/init.py:1 ----> 1 from .aitextgen import aitextgen # noqa

File /opt/homebrew/lib/python3.10/site-packages/aitextgen/aitextgen.py:31 29 from .colab import create_gdrive_folder 30 from .TokenDataset import TokenDataset ---> 31 from .train import ATGProgressBar, ATGTransformer 32 from .utils import ( 33 download_gpt2, 34 find_index_of_subset, (...) 37 set_seed, 38 ) 40 logger = logging.getLogger("aitextgen")

File /opt/homebrew/lib/python3.10/site-packages/aitextgen/train.py:14 12 import pytorch_lightning as pl 13 from pytorch_lightning.callbacks.progress import ProgressBarBase ---> 14 from pytorch_lightning.utilities import _TPU_AVAILABLE 17 class ATGTransformer(pl.LightningModule): ... 18 """ 19 A training module for aitextgen. 20 """

ImportError: cannot import name '_TPU_AVAILABLE' from 'pytorch_lightning.utilities' (/opt/homebrew/lib/python3.10/site-packages/pytorch_lightning/utilities/init.py)

pst2154 commented 1 year ago

Try to restart your kernal after installing

2br-2b commented 1 year ago

Duplicate of #200 - there's a solution also listed there