summaryrefslogtreecommitdiff
path: root/gentext.py
diff options
context:
space:
mode:
Diffstat (limited to 'gentext.py')
-rw-r--r--gentext.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/gentext.py b/gentext.py
index b8a27bf..2079602 100644
--- a/gentext.py
+++ b/gentext.py
@@ -46,7 +46,7 @@ class GenText(SimpleExtension):
sys.stdout.write(self.init_text)
while v.shape[1] < self.max_bytes:
prob = prob / 1.00001
- pred = numpy.random.multinomial(1, prob[0, :]).nonzero()[0][0]
+ pred = numpy.random.multinomial(1, prob[0, :]).nonzero()[0][0].astype('int16')
v = numpy.concatenate([v, pred[None, None]], axis=1)
sys.stdout.write(chr(int(pred)))