Created
April 26, 2020 20:46
-
-
Save StrikingLoo/f8af069414dd7781a6c02ddb2c463c99 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from textgenrnn import textgenrnn | |
import glob | |
textgen = textgenrnn() | |
# textGenRNN.train_from_file requires the whole dataset to be in a single file | |
corpus = '' | |
for file_name in glob.glob('lovecraft_corpus/*'): | |
with open(file_name) as f: | |
corpus+=f.read() | |
with open('lovecraft_corpus.txt', 'w') as f: | |
f.write(corpus) | |
textgen.train_from_file('lovecraft_corpus.txt', num_epochs = 1, batch_size = 4096) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment