2020-08-05 18:36:50 +00:00
|
|
|
from gpt2_client import GPT2Client
|
|
|
|
|
|
|
|
gpt2 = GPT2Client('345M')
|
|
|
|
gpt2.load_model(force_download=False)
|
|
|
|
|
|
|
|
#gpt2.generate(interactive=True) # Asks user for prompt
|
|
|
|
#gpt2.generate(n_samples=4) # Generates 4 pieces of text
|
|
|
|
#text = gpt2.generate(return_text=True) # Generates text and returns it in an array
|
|
|
|
#gpt2.generate(interactive=True, n_samples=1, return_text=True) # A different prompt each time
|
|
|
|
|
2020-08-23 16:54:32 +00:00
|
|
|
my_corpus = "./Corpus/CORPUS.txt"
|
2020-08-05 18:36:50 +00:00
|
|
|
custom_text = gpt2.finetune(my_corpus, return_text=False)
|
|
|
|
|
|
|
|
#print(custom_text)
|