gpt-2-simple · PyPI

PHOTO EMBED

Thu May 06 2021 06:17:47 GMT+0000 (UTC)

Saved by @faheem

import gpt_2_simple as gpt2

gpt2.download_gpt2()   # model is saved into current directory under /models/124M/

sess = gpt2.start_tf_sess()
gpt2.finetune(sess, 'shakespeare.txt', steps=1000)   # steps is max number of training steps

gpt2.generate(sess)
content_copyCOPY

https://pypi.org/project/gpt-2-simple/