This commit is contained in:
Nick Walton
2019-11-18 17:12:45 -07:00
parent 2edb9d46c2
commit 55c22f30e1
24 changed files with 27 additions and 17 deletions
+4
View File
@@ -0,0 +1,4 @@
models
*.pyc
__pycache__
checkpoint
View File
+22
View File
@@ -0,0 +1,22 @@
import tarfile
import os
import gpt_2_simple as gpt2
model_name = "1558M"
if not os.path.isdir(os.path.join("models", model_name)):
print("Downloading ", model_name, " model...")
gpt2.download_gpt2(model_name=model_name) # model is saved into current directory under /models/124M/
file_name = "text_adventures.txt"
sess = gpt2.start_tf_sess()
gpt2.finetune(sess,
file_name,
multi_gpu=True,
batch_size=8,
learning_rate=0.0001,
model_name=model_name,
steps=100)
gpt2.generate(sess)