Skip to content

Possible dependency conflicts in "Interrogating a National Narrative with GPT-2" #3726

@LailaKatharinaHannah

Description

@LailaKatharinaHannah

As a student in an introductory university course on digital history, I tried to recreate the code and analytical operations of "Interrogating a National Narrative with GPT-2" in the Google Colab environment using T4 CPU a few weeks ago. Unfortunately, I was unsuccessful in executing it.

I suspect that the aitextgen library might have become deprecated (the latest version was released on August 9, 2022). I tried downgrading the versions of the libraries aitextgen depends on, but could not find a version of pytorch-lightening that runs in Python 3.12 (which is the Python version that Colab currently employs) and met the requirements of aitextgen:

  • If I specified to use a pytorch-lightning version that is older than 1.6.0., I encountered the following error: "AttributeError: module 'pkgutil' has no attribute 'ImpImporter'".
  • If I specified to use a pytorch-lightning version that is at least 1.6.0 or newer, I encountered another error: "MisconfigurationException: The provided lr scheduler LambdaLR doesn't follow PyTorch's LRScheduler API. You should override the LightningModule.lr_scheduler_step hook with your own logic if you are using a custom LR scheduler."

Since my knowledge of Python is very limited, I was not able to follow the suggested solution in the error code, and it is also possible that there is an easy workaround that I have missed. You can access my code, which includes annotations, via this link: https://colab.research.google.com/drive/1yUlk0tCN9ZbQhGG0QpTP3ifo56c_l02d?usp=sharing
Additionally, I am including my documentation produced for the course.
Documentation-GPT_Language_Models_as_Lenses.pdf

Thank you very much for providing and maintaining so many valuable tutorials that are of great use in my learning journey on digital history!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions