Skip to content

GESIS-Methods-Hub/minimal-example-ipynb-python-gpt2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal Example of Tutorial in Jupyter Notebook running GPT2

Binder

This repository is a minimal example of a Jupyter Notebook running GPT2 (and two other language models). The notebook is located in the index.ipynb file.

Usage

To run the notebook in the cloud using Binder, click on the Binder badge above, or use this link. This will open the notebook in a new tab in your browser.

To run the notebook locally, install the required libraries with conda by running the following command in the terminal. Note: The environment.yml file lists all Python libraries on which your notebooks depends. Remove cpuonly from the environment.yml file if you use a GPU.

conda env create -f environment.yml

Then, activate the environment:

conda activate example-environment

In addition, download the pre-trained GPT2 model by running the following command:

./download_models.py

Finally, start the Jupyter Notebook server:

jupyter-notebook index.ipynb

About

Minimal Example of Tutorial in Jupyter Notebook running GPT2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 73.9%
  • Shell 17.3%
  • Python 8.8%