textgenrnn
textgenrnn copied to clipboard
Error while training new model
I'm using an example from notebook:
`texts = ['Never gonna give you up, never gonna let you down', 'Never gonna run around and desert you', 'Never gonna make you cry, never gonna say goodbye', 'Never gonna tell a lie and hurt you']
textgen.train_on_texts(texts, num_epochs=2, gen_epochs=2)`
but getting an error:
File "//anaconda3/lib/python3.6/site-packages/textgenrnn/textgenrnn.py", line 67, in init weights_path=weights_path)
File "//anaconda3/lib/python3.6/site-packages/textgenrnn/model.py", line 32, in textgenrnn_model attention = AttentionWeightedAverage(name='attention')(seq_concat)
File "//anaconda3/lib/python3.6/site-packages/textgenrnn/AttentionWeightedAverage.py", line 17, in init super(AttentionWeightedAverage, self).init(** kwargs)
TypeError: super(type, obj): obj must be an instance or subtype of type
Does anybody solve this problem?
you need to make a txt file and use this code
import textgenrnn from textgenrnn import textgenrnn textgen = textgenrnn() textgen.train_from_file('txt file name here.txt', num_epochs=10) textgen.generate(15, temperature=1.0)