Initial commit

This commit is contained in:
Tony Bark 2025-03-11 22:26:45 -04:00
commit f58a2e46bd
44 changed files with 4051 additions and 0 deletions

4
generator/simple/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
models
*.pyc
__pycache__
checkpoint

View file

View file

@ -0,0 +1,29 @@
import os
import tarfile
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=32,
learning_rate=0.0001,
model_name=model_name,
sample_every=10000,
max_checkpoints=8,
save_every=200,
steps=1000,
)
gpt2.generate(sess)