mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-25 13:10:22 +08:00
15 lines
483 B
Python
15 lines
483 B
Python
import gpt_2_simple as gpt2
|
|
import os
|
|
import requests
|
|
|
|
model_name = "1558M"
|
|
if not os.path.isdir(os.path.join("models", model_name)):
|
|
print(f"Downloading {model_name} model...")
|
|
gpt2.download_gpt2(model_name=model_name) # model is saved into current directory under /models/124M/
|
|
|
|
sess = gpt2.start_tf_sess()
|
|
gpt2.load_gpt2(sess, model_name=model_name)
|
|
gpt2.generate(sess, model_name=model_name, length=30, prefix="I wake up in an old rundown hospital. I look around and see")
|
|
|
|
|