Python package to easily retrain OpenAI’s GPT-2 text-generating model on new texts

gen_demo

A simple Python package that wraps existing model fine-tuning and generation scripts for OpenAI‘s GPT-2 text generation model (specifically the “small” 124M and “medium” 355M hyperparameter versions). Additionally, this package allows easier generation of text, generating to a file for easy curation, allowing for prefixes to force the text to start with a given phrase.

This package incorporates and makes minimal low-level changes to:

  • Model management from OpenAI’s official GPT-2 repo (MIT License)
  • Model finetuning from Neil Shepperd’s fork of GPT-2 (MIT License)
  • Text generation output management from textgenrnn (MIT License / also created by me)

For finetuning, it is strongly recommended to use a GPU, although you can generate using a CPU (albeit much

 

 

 

To finish reading, please visit source site